hlsdemux: Do not clear/advance fragment by finished header downloading
authorSeungha Yang <seungha.yang@navercorp.com>
Mon, 30 Jan 2017 05:13:06 +0000 (14:13 +0900)
committerSebastian Dröge <slomo@coaxion.net>
Tue, 18 Jun 2019 07:14:28 +0000 (07:14 +0000)
Header data must be forwarded to downstream, but if demux does not finish
to finding type (e.g., ts, mp4 and etc), this header data can be cleared
by _stream_clear_pending_data(). Moreover, although demux finish downloading
header data, still it has fragment date to be downloaded, fragment sequence
shouldn't be advanced yet at that moment.

https://bugzilla.gnome.org/show_bug.cgi?id=776928

ext/hls/gsthlsdemux.c

index 4317d65..013f12a 100644 (file)
@@ -947,6 +947,9 @@ gst_hls_demux_finish_fragment (GstAdaptiveDemux * demux,
     }
   }
 
+  if (G_UNLIKELY (stream->downloading_header || stream->downloading_index))
+    return GST_FLOW_OK;
+
   gst_hls_demux_stream_clear_pending_data (hls_stream);
 
   if (ret == GST_FLOW_OK || ret == GST_FLOW_NOT_LINKED)