[0.11] gst-plugins-good: flvdemux: activate pad before setting caps

Mark Nauwelaerts mnauw at kemper.freedesktop.org
Thu Jan 12 02:16:20 PST 2012


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

Author: Mark Nauwelaerts <mark.nauwelaerts at collabora.co.uk>
Date:   Thu Jan 12 11:07:33 2012 +0100

flvdemux: activate pad before setting caps

... rather than the usual 0.10 other way around.

Fixes #667558.

---

 gst/flv/gstflvdemux.c |   45 +++++++++++++++++++++++----------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/gst/flv/gstflvdemux.c b/gst/flv/gstflvdemux.c
index 7603dba..7f83e61 100644
--- a/gst/flv/gstflvdemux.c
+++ b/gst/flv/gstflvdemux.c
@@ -902,6 +902,17 @@ gst_flv_demux_parse_tag_audio (GstFlvDemux * demux, GstBuffer * buffer)
       goto beach;
     }
 
+    /* Set functions on the pad */
+    gst_pad_set_query_function (demux->audio_pad,
+        GST_DEBUG_FUNCPTR (gst_flv_demux_query));
+    gst_pad_set_event_function (demux->audio_pad,
+        GST_DEBUG_FUNCPTR (gst_flv_demux_src_event));
+
+    gst_pad_use_fixed_caps (demux->audio_pad);
+
+    /* Make it active */
+    gst_pad_set_active (demux->audio_pad, TRUE);
+
     /* Negotiate caps */
     if (!gst_flv_demux_audio_negotiate (demux, codec_tag, rate, channels,
             width)) {
@@ -922,17 +933,6 @@ gst_flv_demux_parse_tag_audio (GstFlvDemux * demux, GstBuffer * buffer)
     }
 #endif
 
-    /* Set functions on the pad */
-    gst_pad_set_query_function (demux->audio_pad,
-        GST_DEBUG_FUNCPTR (gst_flv_demux_query));
-    gst_pad_set_event_function (demux->audio_pad,
-        GST_DEBUG_FUNCPTR (gst_flv_demux_src_event));
-
-    gst_pad_use_fixed_caps (demux->audio_pad);
-
-    /* Make it active */
-    gst_pad_set_active (demux->audio_pad, TRUE);
-
     /* We need to set caps before adding */
     gst_element_add_pad (GST_ELEMENT (demux),
         gst_object_ref (demux->audio_pad));
@@ -1274,6 +1274,18 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer)
       goto beach;
     }
 
+    /* Set functions on the pad */
+    gst_pad_set_query_function (demux->video_pad,
+        GST_DEBUG_FUNCPTR (gst_flv_demux_query));
+    gst_pad_set_event_function (demux->video_pad,
+        GST_DEBUG_FUNCPTR (gst_flv_demux_src_event));
+
+    gst_pad_use_fixed_caps (demux->video_pad);
+
+    /* Make it active */
+    gst_pad_set_active (demux->video_pad, TRUE);
+
+    /* Needs to be active before setting caps */
     if (!gst_flv_demux_video_negotiate (demux, codec_tag)) {
       gst_object_unref (demux->video_pad);
       demux->video_pad = NULL;
@@ -1297,17 +1309,6 @@ gst_flv_demux_parse_tag_video (GstFlvDemux * demux, GstBuffer * buffer)
     }
 #endif
 
-    /* Set functions on the pad */
-    gst_pad_set_query_function (demux->video_pad,
-        GST_DEBUG_FUNCPTR (gst_flv_demux_query));
-    gst_pad_set_event_function (demux->video_pad,
-        GST_DEBUG_FUNCPTR (gst_flv_demux_src_event));
-
-    gst_pad_use_fixed_caps (demux->video_pad);
-
-    /* Make it active */
-    gst_pad_set_active (demux->video_pad, TRUE);
-
     /* We need to set caps before adding */
     gst_element_add_pad (GST_ELEMENT (demux),
         gst_object_ref (demux->video_pad));



More information about the gstreamer-commits mailing list