vaapisink: ignore frame if its upload failed
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Wed, 13 Jan 2016 18:17:02 +0000 (19:17 +0100)
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Thu, 14 Jan 2016 10:31:17 +0000 (11:31 +0100)
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

gst/vaapi/gstvaapisink.c

index fd22524..f52c4da 100644 (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),
       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;
 
   meta = gst_buffer_get_vaapi_video_meta (buffer);