summaryrefslogtreecommitdiff
path: root/gst/vaapi/gstvaapisink.c
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-01-13 19:17:02 +0100
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-01-14 11:31:17 +0100
commit8f77d541039759a82ca65b1bcd65ff1406eca34a (patch)
tree06385aa965856ac939dd24c44b243da8a47d5004 /gst/vaapi/gstvaapisink.c
parent1a84348e766220831aa26bfa50b8aeefec0ebdd4 (diff)
downloadgst-vaapi-8f77d541039759a82ca65b1bcd65ff1406eca34a.tar.gz
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
Diffstat (limited to 'gst/vaapi/gstvaapisink.c')
-rw-r--r--gst/vaapi/gstvaapisink.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c
index fd225242..f52c4da8 100644
--- a/gst/vaapi/gstvaapisink.c
+++ b/gst/vaapi/gstvaapisink.c
@@ -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);