mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 06:26:23 +00:00
collectpads2: Fix refcount handling if a buffer was dropped due to clipping
This commit is contained in:
parent
2f100e86f6
commit
1eb3380973
1 changed files with 3 additions and 2 deletions
|
@ -1827,11 +1827,11 @@ gst_collect_pads2_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
if (pads->clip_func) {
|
if (pads->clip_func) {
|
||||||
GstBuffer *outbuf = NULL;
|
GstBuffer *outbuf = NULL;
|
||||||
ret = pads->clip_func (pads, data, buffer, &outbuf, pads->clip_user_data);
|
ret = pads->clip_func (pads, data, buffer, &outbuf, pads->clip_user_data);
|
||||||
|
buffer = outbuf;
|
||||||
|
|
||||||
if (G_UNLIKELY (outbuf == NULL))
|
if (G_UNLIKELY (outbuf == NULL))
|
||||||
goto clipped;
|
goto clipped;
|
||||||
|
|
||||||
buffer = outbuf;
|
|
||||||
if (G_UNLIKELY (ret == GST_FLOW_UNEXPECTED))
|
if (G_UNLIKELY (ret == GST_FLOW_UNEXPECTED))
|
||||||
goto unexpected;
|
goto unexpected;
|
||||||
else if (G_UNLIKELY (ret != GST_FLOW_OK))
|
else if (G_UNLIKELY (ret != GST_FLOW_OK))
|
||||||
|
@ -1912,6 +1912,7 @@ gst_collect_pads2_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
unlock_done:
|
unlock_done:
|
||||||
GST_COLLECT_PADS2_STREAM_UNLOCK (pads);
|
GST_COLLECT_PADS2_STREAM_UNLOCK (pads);
|
||||||
unref_data (data);
|
unref_data (data);
|
||||||
|
if (buffer)
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue