From c0462fe0c845b941f1724a93a5bc6041716b48c6 Mon Sep 17 00:00:00 2001 From: gb Date: Thu, 18 Mar 2010 08:45:57 +0000 Subject: [PATCH] Check if our inout buffer is still alive or default to a separate output buffer. --- sys/vaapiconvert/gstvaapiconvert.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sys/vaapiconvert/gstvaapiconvert.c b/sys/vaapiconvert/gstvaapiconvert.c index a30aceb4f3..5e64ed4445 100644 --- a/sys/vaapiconvert/gstvaapiconvert.c +++ b/sys/vaapiconvert/gstvaapiconvert.c @@ -527,14 +527,13 @@ gst_vaapiconvert_prepare_output_buffer( GstVaapiConvert * const convert = GST_VAAPICONVERT(trans); GstBuffer *buffer; - if (convert->use_inout_buffers) { - if (!GST_VAAPI_IS_VIDEO_BUFFER(inbuf)) { - GST_DEBUG("GstVaapiVideoBuffer was expected"); - return GST_FLOW_UNEXPECTED; - } + if (GST_VAAPI_IS_VIDEO_BUFFER(inbuf)) buffer = gst_buffer_ref(inbuf); - } else { + if (convert->use_inout_buffers) { + GST_DEBUG("upstream element destroyed our inout buffer"); + convert->use_inout_buffers = FALSE; + } buffer = gst_vaapi_video_buffer_new_from_pool(convert->surfaces); if (!buffer) return GST_FLOW_UNEXPECTED;