Commit 6b259abc authored by Gwenole Beauchesne's avatar Gwenole Beauchesne

vaapipostproc: fix reference counting buf for passthrough mode.

Fix reference counting bug for passthrough mode, whereby the input buffer
was propagated as is downstream through gst_pad_push() without increasing
its reference count before. The was a problem when gst_pad_push() returns
an error and we further decrease the reference count of the input buffer.
parent 945516c9
......@@ -258,10 +258,13 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
/* Deinterlacing disabled, push frame */
if (!postproc->deinterlace) {
gst_vaapi_video_meta_set_render_flags(meta, flags);
ret = gst_pad_push(postproc->srcpad, buf);
outbuf = gst_buffer_ref(buf);
if (!outbuf)
goto error_create_buffer;
ret = gst_pad_push(postproc->srcpad, outbuf);
if (ret != GST_FLOW_OK)
goto error_push_buffer;
gst_buffer_unref(buf);
return GST_FLOW_OK;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment