appsink: caps event error, caps still have parent
I have a pipeline where my capture source captures resizable windows. As a result, I will send arbitrary caps events down the pipe whenever a window is resized. My pipeline contains an appsink. Once the appsink receives the caps event here, it first parses the caps and then tries to update some private data.
As we try to replace
last_caps of the private data with the new caps here. I get an error in the free_priv_data function of the gst_mini_object class code. I presume this is because the caps stored in
priv->last_caps still have
priv->sample as parent.
I'm not sure but to resolve this issue it might be sufficient to move the call
gst_caps_replace (&priv->last_caps, caps); below the other two lines, so that first the caps in the sample get replaced (which would remove the parent from
priv->last_caps as can be seen here). Afterwards,
priv->last_caps should be safe to unref.
I can create a PR for this if someone agrees that this is indeed a valid solution.