Commit 7655d6c8 authored by Ilkka Ollakka's avatar Ilkka Ollakka

httplive: don't reload playlist all the time.

Reload playlist only when there is only 1 or 0 segments left that are
downloaded but not played yet. Also change the default interval to be
segment length instead of half segment length.

With this patch it downloads 3 segments from 5 seglen playlist at the
time and then plays those. Should be much nicer on http-server and
powersaving (marginally as there isn't network activity that often).
parent 7fa797f3
......@@ -1700,14 +1700,15 @@ static void* hls_Reload(void *p_this)
int canc = vlc_savecancel();
double wait = 0.5;
double wait = 1.0;
while (vlc_object_alive(s))
{
mtime_t now = mdate();
if (now >= p_sys->playlist.wakeup)
{
/* reload the m3u8 */
if (hls_ReloadPlaylist(s) != VLC_SUCCESS)
/* reload the m3u8 if there are less than 2 segments what aren't downloaded */
if ( ( p_sys->download.segment - p_sys->playback.segment < 2 ) &&
( hls_ReloadPlaylist(s) != VLC_SUCCESS) )
{
/* No change in playlist, then backoff */
p_sys->playlist.tries++;
......@@ -1725,7 +1726,7 @@ static void* hls_Reload(void *p_this)
else
{
p_sys->playlist.tries = 0;
wait = 0.5;
wait = 1.0;
}
hls_stream_t *hls = hls_Get(p_sys->hls_stream, p_sys->download.stream);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment