tsdemux: Set caps/tags in the GstStream object before pushing the stream-start event
authorSebastian Dröge <sebastian@centricular.com>
Tue, 24 Jan 2017 21:10:19 +0000 (23:10 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 25 Jan 2017 12:23:17 +0000 (14:23 +0200)
Otherwise downstream will get a more or less empty GstStream although we
already know a lot about it at this point.

gst/mpegtsdemux/tsdemux.c

index c701c37f2a24073f21765401e581bc48734d47f2..abe21a15290854bf0ed488d714db393e942033b1 100644 (file)
@@ -1621,15 +1621,15 @@ done:
           GST_STREAM_FLAG_SPARSE);
     }
     stream->sparse = sparse;
-
-    gst_pad_push_event (pad, event);
-    gst_pad_set_caps (pad, caps);
     gst_stream_set_caps (bstream->stream_object, caps);
     if (!stream->taglist)
       stream->taglist = gst_tag_list_new_empty ();
     gst_pb_utils_add_codec_description_to_tag_list (stream->taglist, NULL,
         caps);
     gst_stream_set_tags (bstream->stream_object, stream->taglist);
+
+    gst_pad_push_event (pad, event);
+    gst_pad_set_caps (pad, caps);
     gst_pad_set_query_function (pad, gst_ts_demux_srcpad_query);
     gst_pad_set_event_function (pad, gst_ts_demux_srcpad_event);
   }