vlc | branch: master | Ilkka Ollakka <[email protected]> | Mon Aug 26 16:08:56 2013 +0300| [7655d6c889d2425c1fd4615f7e2692df1a47470c] | committer: 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). > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7655d6c889d2425c1fd4615f7e2692df1a47470c --- modules/stream_filter/httplive.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c index be3d5ed..926acf9 100644 --- a/modules/stream_filter/httplive.c +++ b/modules/stream_filter/httplive.c @@ -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); _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
