adaptivedemux: do not try to advance fragment if there is none
authorThiago Santos <thiagoss@osg.samsung.com>
Fri, 27 Mar 2015 03:27:34 +0000 (00:27 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Fri, 27 Mar 2015 19:22:57 +0000 (16:22 -0300)
It might return OK from subclasses and it could cause a bitrate
renegotiation. For DASH and MSS that is ok as they won't expose
new pads as part of this but it can cause issues for HLS as
it will expose new pads, leading to pads that will only have EOS
that cause decodebin to fail

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

gst-libs/gst/adaptivedemux/gstadaptivedemux.c

index cf4a317..1c6a359 100644 (file)
@@ -2395,7 +2395,13 @@ gst_adaptive_demux_stream_advance_fragment_unlocked (GstAdaptiveDemux * demux,
 
   if (GST_CLOCK_TIME_IS_VALID (duration))
     stream->segment.position += duration;
-  ret = klass->stream_advance_fragment (stream);
+
+  if (gst_adaptive_demux_is_live (demux)
+      || gst_adaptive_demux_stream_has_next_fragment (demux, stream)) {
+    ret = klass->stream_advance_fragment (stream);
+  } else {
+    ret = GST_FLOW_EOS;
+  }
 
   stream->download_start_time = stream->download_chunk_start_time =
       g_get_monotonic_time ();