vaapisink: ignore frame if its upload failed

When gst_vaapi_plugin_base_get_input_buffer() fail to copy the input buffer
into a VAAPI buffer, the return value is GST_FLOW_NOT_SUPPORTED, and it was
ignored by the vaapisink, leading to a segmentation fault.

This patch ignores the frame that generated the GST_FLOW_NOT_SUPPORTED
returned by gst_vaapi_plugin_base_get_input_buffer(), avoiding the
segmentation fault, but doing and effort to continue rendering. This is
the same behavior of ximagesink.

Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=759332
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-01-13 19:17:02 +01:00
parent 1a84348e76
commit 8f77d54103

View file

@ -1333,7 +1333,9 @@ gst_vaapisink_show_frame_unlocked (GstVaapiSink * sink, GstBuffer * src_buffer)
ret = gst_vaapi_plugin_base_get_input_buffer (GST_VAAPI_PLUGIN_BASE (sink), ret = gst_vaapi_plugin_base_get_input_buffer (GST_VAAPI_PLUGIN_BASE (sink),
src_buffer, &buffer); src_buffer, &buffer);
if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_SUPPORTED) if (ret == GST_FLOW_NOT_SUPPORTED)
return GST_FLOW_OK; /* let's ignore the frame if it couldn't be uploaded */
if (ret != GST_FLOW_OK)
return ret; return ret;
meta = gst_buffer_get_vaapi_video_meta (buffer); meta = gst_buffer_get_vaapi_video_meta (buffer);