hlsdemux: Also refetch the playlist after the first fragment failure

Previously we only refetched the playlist if downloading a fragment
has failed once. We should also do that if it failed a second or third time,
chances are that the playlist was updated now and contains new URIs.
This commit is contained in:
Sebastian Dröge 2014-09-15 13:33:45 +03:00
parent 1ce7d89868
commit 775c5600c9

View file

@ -1211,6 +1211,7 @@ gst_hls_demux_stream_loop (GstHLSDemux * demux)
&& !gst_m3u8_client_is_live (demux->client)
&& gst_hls_demux_update_playlist (demux, FALSE, &err)) {
/* Retry immediately, the playlist actually has changed */
GST_DEBUG_OBJECT (demux, "Updated the playlist");
return;
} else {
/* Wait half the fragment duration before retrying */
@ -1231,6 +1232,12 @@ gst_hls_demux_stream_loop (GstHLSDemux * demux)
demux->next_download);
g_mutex_unlock (&demux->download_lock);
GST_DEBUG_OBJECT (demux, "Retrying now");
/* Refetch the playlist now after we waited */
if (!gst_m3u8_client_is_live (demux->client)
&& gst_hls_demux_update_playlist (demux, FALSE, &err)) {
GST_DEBUG_OBJECT (demux, "Updated the playlist");
}
return;
} else {
GST_ELEMENT_ERROR_FROM_ERROR (demux,