[0.11] gst-plugins-base: streamcombiner: fix srcpad query caps

Wim Taymans wtay at kemper.freedesktop.org
Mon Jan 2 09:29:33 PST 2012


Module: gst-plugins-base
Branch: 0.11
Commit: e2f91075e44d4c6a4dd128cb8a783412c1dedf17
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=e2f91075e44d4c6a4dd128cb8a783412c1dedf17

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Mon Jan  2 18:28:46 2012 +0100

streamcombiner: fix srcpad query caps

The caps query on the srcpad should return the template caps instead of
forwarding the query.

---

 gst/encoding/gststreamcombiner.c |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/gst/encoding/gststreamcombiner.c b/gst/encoding/gststreamcombiner.c
index 5cf7629..19a6adf 100644
--- a/gst/encoding/gststreamcombiner.c
+++ b/gst/encoding/gststreamcombiner.c
@@ -166,19 +166,26 @@ gst_stream_combiner_src_query (GstPad * pad, GstObject * parent,
 {
   GstStreamCombiner *stream_combiner = (GstStreamCombiner *) parent;
   GstPad *sinkpad = NULL;
+  gboolean ret = FALSE;
 
-  STREAMS_LOCK (stream_combiner);
-  if (stream_combiner->current)
-    sinkpad = stream_combiner->current;
-  else if (stream_combiner->sinkpads)
-    sinkpad = (GstPad *) stream_combiner->sinkpads->data;
-  STREAMS_UNLOCK (stream_combiner);
-
-  if (sinkpad)
-    /* Forward upstream as is */
-    return gst_pad_peer_query (sinkpad, query);
-
-  return FALSE;
+  switch (GST_QUERY_TYPE (query)) {
+    case GST_QUERY_CAPS:
+      ret = gst_pad_query_default (pad, parent, query);
+      break;
+    default:
+      STREAMS_LOCK (stream_combiner);
+      if (stream_combiner->current)
+        sinkpad = stream_combiner->current;
+      else if (stream_combiner->sinkpads)
+        sinkpad = (GstPad *) stream_combiner->sinkpads->data;
+      STREAMS_UNLOCK (stream_combiner);
+
+      if (sinkpad)
+        /* Forward upstream as is */
+        ret = gst_pad_peer_query (sinkpad, query);
+      break;
+  }
+  return ret;
 }
 
 static void



More information about the gstreamer-commits mailing list