mpegts: Also clear packetizer on TIME DISCONT
authorEdward Hervey <edward@centricular.com>
Sat, 8 Oct 2016 12:08:06 +0000 (14:08 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Sat, 8 Oct 2016 12:14:00 +0000 (14:14 +0200)
When dealing with TIME-based input, the incoming stream could have
potentially changed completely.

In order to check whether it did or not, we need to re-check all sections
(PAT, PMT...). If it didn't, we will keep using the existing streams/pad,
and if it did we will act as if there was a program switch.

Fixes HLS streaming with decodebin3/playbin3

gst/mpegtsdemux/mpegtsbase.c

index 659faad..4aa01e3 100644 (file)
@@ -1164,9 +1164,10 @@ mpegts_base_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
      * we want to drop all previous observations (hard:TRUE) from
      * the packetizer */
     if (base->mode == BASE_MODE_PUSHING
-        && base->segment.format == GST_FORMAT_TIME)
+        && base->segment.format == GST_FORMAT_TIME) {
       mpegts_packetizer_flush (base->packetizer, TRUE);
-    else
+      mpegts_packetizer_clear (base->packetizer);
+    } else
       mpegts_packetizer_flush (base->packetizer, FALSE);
   }