From 578f7886509f39d34e47baa2c53ba718d2e15122 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Tue, 26 Mar 2013 18:57:00 +0100 Subject: [PATCH] plugins: fix usage of gst_vaapi_reply_to_query(). Make gst_vaapi_reply_to_query() first check whether the query argument is actually a video-context query, i.e. with type GST_QUERY_TYPE_CUSTOM. Then, make sure vaapisink propagates the query to the parent class if it is not a video-context query. --- gst/vaapi/gstvaapipluginutil.c | 3 +++ gst/vaapi/gstvaapisink.c | 11 ++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index d42fa21943..df311142c8 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -220,6 +220,9 @@ gst_vaapi_reply_to_query(GstQuery *query, GstVaapiDisplay *display) gint i; gboolean res = FALSE; + if (GST_QUERY_TYPE(query) != GST_QUERY_CUSTOM) + return FALSE; + if (!display) return FALSE; diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index 0669d22906..fbf931cf7f 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -961,9 +961,14 @@ gst_vaapisink_buffer_alloc( static gboolean gst_vaapisink_query(GstBaseSink *base_sink, GstQuery *query) { - GstVaapiSink *sink = GST_VAAPISINK(base_sink); - GST_DEBUG ("sharing display %p", sink->display); - return gst_vaapi_reply_to_query (query, sink->display); + GstVaapiSink * const sink = GST_VAAPISINK(base_sink); + + if (gst_vaapi_reply_to_query(query, sink->display)) { + GST_DEBUG("sharing display %p", sink->display); + return TRUE; + } + return GST_BASE_SINK_CLASS(gst_vaapisink_parent_class)->query(base_sink, + query); } static void