summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-07-13 12:57:12 +0200
committerEdward Hervey <bilboed@bilboed.com>2017-07-13 13:09:00 +0200
commit2f01c7e56e57547379cd3e5e733921dd6128a50f (patch)
tree5f3213250c781b8e5f2b757d984169191ec661cb
parent4fc49a28faff578fa8dd4ed9384424fcd1302060 (diff)
downloadgstreamer-plugins-bad-2f01c7e56e57547379cd3e5e733921dd6128a50f.tar.gz
adaptivedemux: Workaround for live seek ranges when advancing
This is a workaround for a regression introduced by f4190a49c04f1d5d174cebba0bc9a03a7ec721c2 ( adaptivedemux: Check live seeking range more often ) The goal of the previous commit was to be able to cope with non-1.0 rates on live streams which have a "seeking window" (i.e. the server keeps around quite a bit of the live stream so you can seek back into it). Without that commit, two different kind of issues would happen: * When doing reverse playback, you would never check whether you are outside of the seekable region. And would then continuously try to download fragments that are no longer present. * When doing fast forward, you would end up requesting fragments which are not present yet. In order to determine whether one was *really* outside of the seekable window, we check whether the current stream position is still within the seekable region. The *problem* though with that commit is that it assumes that subclasses will return continuously updated seeking ranges (i.e. dependent on the current time), which is *NOT* the case. For example: * dashdemux does use the current UTC to determine the seekable region * hlsdemux uses the values from the last updated manifest Therefore if one downloads fragments faster than realtime, for HLS we would end up at the end of the last manifest seekable range, and the previous commit would consider the stream as being ended... which is not the case. In the long run, we need to figure out a way to cope with non-1.0 rates on live streams for all types of stream (including HLS). https://bugzilla.gnome.org/show_bug.cgi?id=783075
-rw-r--r--gst-libs/gst/adaptivedemux/gstadaptivedemux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
index dc2358570..cc1171634 100644
--- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
+++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
@@ -3606,9 +3606,12 @@ gst_adaptive_demux_stream_download_loop (GstAdaptiveDemuxStream * stream)
break; /* all is good, let's go */
case GST_FLOW_EOS:
GST_DEBUG_OBJECT (stream->pad, "EOS, checking to stop download loop");
+
/* we push the EOS after releasing the object lock */
if (gst_adaptive_demux_is_live (demux)
- && gst_adaptive_demux_stream_in_live_seek_range (demux, stream)) {
+ && (demux->segment.rate == 1.0
+ || gst_adaptive_demux_stream_in_live_seek_range (demux,
+ stream))) {
GstAdaptiveDemuxClass *demux_class =
GST_ADAPTIVE_DEMUX_GET_CLASS (demux);