gstdashdemux: add need_header member to know whether the initialization fragment...
authorLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>
Wed, 23 Jan 2013 21:43:12 +0000 (16:43 -0500)
committerThiago Santos <thiago.sousa.santos@collabora.com>
Wed, 8 May 2013 21:14:33 +0000 (18:14 -0300)
ext/dash/gstdashdemux.c
ext/dash/gstdashdemux.h

index 6bfeeb4..8177e54 100644 (file)
@@ -593,6 +593,7 @@ gst_dash_demux_src_event (GstPad * pad, GstEvent * event)
       demux->position = gst_mpd_client_get_current_position (demux->client);
       demux->position_shift = start - demux->position;
       demux->need_segment = TRUE;
+      demux->need_header = TRUE;
       //GST_MPD_CLIENT_UNLOCK (demux->client);
 
       if (flags & GST_SEEK_FLAG_FLUSH) {
@@ -1113,6 +1114,7 @@ gst_dash_demux_reset (GstDashDemux * demux, gboolean dispose)
   demux->last_manifest_update = GST_CLOCK_TIME_NONE;
   demux->position = 0;
   demux->position_shift = 0;
+  demux->need_header = TRUE;
   demux->need_segment = TRUE;
 }
 
@@ -1641,7 +1643,8 @@ need_add_header (GstDashDemux * demux)
     caps = gst_dash_demux_get_input_caps (demux, stream);
     if (!demux->input_caps[stream_idx]
         || !gst_caps_is_equal (caps, demux->input_caps[stream_idx])
-        || demux->need_segment) {
+        || demux->need_header) {
+      demux->need_header = FALSE;
       switch_caps = TRUE;
       gst_caps_unref (caps);
       break;
index 9508361..dcaefd0 100644 (file)
@@ -97,6 +97,7 @@ struct _GstDashDemux
   GstClockTime position;
   GstClockTime position_shift;
   GstClockTime last_position_shift;
+  gboolean need_header;
   gboolean need_segment;
   /* Download rate */
   guint64 dnl_rate;