On Mon Mar 3 08:51:18 2025 +0000, Rémi Bernon wrote:
/* We try to intercept buffers produced by the parser, so if we push a large buffer into the * parser, it won't push everything into the decoder all in one go. */ if ((element = create_element("winegstreamerstepper", NULL))) { if (!append_element(transform->container, element, first, last)) g_object_unref(element); else /* element is owned by the container */ transform->stepper = WG_STEPPER(element); }
Please keep this like the other invocations, and as I've suggested above. Ownership is transferred in the append_element call, whether it succeeds or not. If there's anything to fix, it might be in `append_element` itself, depending on whether ownership is indeed preserved if `gst_bin_add` fails, but it's not clear from the documentation, and there are other cases where that calls succeed but `append_element` might still fail in which case ownership has been transferred already.
ok, i changed it. hopefully this is what you meant?
i also checked the code of `gst_bin_add` and can confirm it does always take the ownership of `element`.