summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2015-08-15 19:01:00 +0200
committerEdward Hervey <bilboed@bilboed.com>2015-08-15 19:04:42 +0200
commit69867f95e2dd53ba9542500db9efbc09f464c400 (patch)
treeb4cb3b9839e428397f40ec73c84aa6f2327d9d35
parentc90f6b990b64049b9feb68c0eb34ec3acd15cee8 (diff)
downloadgstreamer-plugins-bad-69867f95e2dd53ba9542500db9efbc09f464c400.tar.gz
adaptivedemux: Actually wait for playlist update when requested
There are several cases where a HLS server could temporarily have wrong fragments, or reconfigure the playlist. In those cases, when we get fragment download failures, we *really* want to wait a bit (for the next playlist update) before retrying to get fragments. Previously this method was first checking to see if there was next fragments (according to the previous manifest update) before waiting for the next update. The problem was that if that if there is a temporary failure on the server, that's uncorrelated to whether the manifest contains next fragments or not.
-rw-r--r--gst-libs/gst/adaptivedemux/gstadaptivedemux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
index 3065de492..2ee90c9cb 100644
--- a/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
+++ b/gst-libs/gst/adaptivedemux/gstadaptivedemux.c
@@ -1645,6 +1645,9 @@ gst_adaptive_demux_stream_wait_manifest_update (GstAdaptiveDemux * demux,
break;
}
+ GST_DEBUG_OBJECT (demux, "No fragment left but live playlist, wait a bit");
+ g_cond_wait (&demux->manifest_cond, GST_MANIFEST_GET_LOCK (demux));
+
/* Got a new fragment or not live anymore? */
if (gst_adaptive_demux_stream_has_next_fragment (demux, stream)) {
GST_DEBUG_OBJECT (demux, "new fragment available, "
@@ -1659,9 +1662,6 @@ gst_adaptive_demux_stream_wait_manifest_update (GstAdaptiveDemux * demux,
ret = FALSE;
break;
}
-
- GST_DEBUG_OBJECT (demux, "No fragment left but live playlist, wait a bit");
- g_cond_wait (&demux->manifest_cond, GST_MANIFEST_GET_LOCK (demux));
}
GST_DEBUG_OBJECT (demux, "Retrying now");
return ret;