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.
This commit is contained in:
Gwenole Beauchesne 2013-04-17 10:53:03 +02:00
parent 945516c9c7
commit 6b259abc02

View file

@ -258,10 +258,13 @@ gst_vaapipostproc_process(GstVaapiPostproc *postproc, GstBuffer *buf)
/* Deinterlacing disabled, push frame */ /* Deinterlacing disabled, push frame */
if (!postproc->deinterlace) { if (!postproc->deinterlace) {
gst_vaapi_video_meta_set_render_flags(meta, flags); outbuf = gst_buffer_ref(buf);
ret = gst_pad_push(postproc->srcpad, buf); if (!outbuf)
goto error_create_buffer;
ret = gst_pad_push(postproc->srcpad, outbuf);
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)
goto error_push_buffer; goto error_push_buffer;
gst_buffer_unref(buf);
return GST_FLOW_OK; return GST_FLOW_OK;
} }