Check if our inout buffer is still alive or default to a separate output buffer.

This commit is contained in:
gb 2010-03-18 08:45:57 +00:00
parent 79c168751a
commit c0462fe0c8

View file

@ -527,14 +527,13 @@ gst_vaapiconvert_prepare_output_buffer(
GstVaapiConvert * const convert = GST_VAAPICONVERT(trans); GstVaapiConvert * const convert = GST_VAAPICONVERT(trans);
GstBuffer *buffer; GstBuffer *buffer;
if (convert->use_inout_buffers) { if (GST_VAAPI_IS_VIDEO_BUFFER(inbuf))
if (!GST_VAAPI_IS_VIDEO_BUFFER(inbuf)) {
GST_DEBUG("GstVaapiVideoBuffer was expected");
return GST_FLOW_UNEXPECTED;
}
buffer = gst_buffer_ref(inbuf); buffer = gst_buffer_ref(inbuf);
}
else { 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); buffer = gst_vaapi_video_buffer_new_from_pool(convert->surfaces);
if (!buffer) if (!buffer)
return GST_FLOW_UNEXPECTED; return GST_FLOW_UNEXPECTED;