hlsdemux: If a fetch fails, decrement the sequence number

This commit is contained in:
Youness Alaoui 2011-09-03 00:36:34 +00:00 committed by Sebastian Dröge
parent 5aa972eab2
commit 473e71e1ca

View file

@ -1310,8 +1310,15 @@ gst_hls_demux_get_next_fragment (GstHLSDemux * demux)
GST_INFO_OBJECT (demux, "Fetching next fragment %s", next_fragment_uri); GST_INFO_OBJECT (demux, "Fetching next fragment %s", next_fragment_uri);
if (!gst_hls_demux_fetch_location (demux, next_fragment_uri)) if (!gst_hls_demux_fetch_location (demux, next_fragment_uri)) {
/* FIXME: The gst_m3u8_get_next_fragment increments the sequence number
but another thread might call get_next_fragment and this decrement
will not redownload the failed fragment, but might duplicate the
download of a succeeded fragment
*/
g_atomic_int_add (&demux->client->sequence, -1);
return FALSE; return FALSE;
}
avail = gst_adapter_available (demux->download); avail = gst_adapter_available (demux->download);
buf = gst_adapter_take_buffer (demux->download, avail); buf = gst_adapter_take_buffer (demux->download, avail);