plugins: fix usage of gst_vaapi_reply_to_query().
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 26 Mar 2013 17:57:00 +0000 (18:57 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Tue, 26 Mar 2013 17:57:00 +0000 (18:57 +0100)
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
gst/vaapi/gstvaapisink.c

index d42fa21..df31114 100644 (file)
@@ -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;
 
index 0669d22..fbf931c 100644 (file)
@@ -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