httplive: Adjust conditions for playlist reloading
authorHeorhi Valakhanovich <valahanovich@tut.by>
Sun, 15 Dec 2013 22:28:34 +0000 (01:28 +0300)
committerIlkka Ollakka <ileoo@videolan.org>
Tue, 7 Jan 2014 07:07:24 +0000 (09:07 +0200)
Commit 7655d6c889d2425c1fd4615f7e2692df1a47470c changes HLS http
playlist reloading policy. But leaving only one fragment in buffer is
not enough. This patch ensures that less than three fragments in buffer
leads to playlist reloading. The overal result is more reliable http
streams.

Signed-off-by: Ilkka Ollakka <ileoo@videolan.org>
modules/stream_filter/httplive.c

index 050d782..12304d3 100644 (file)
@@ -1718,8 +1718,8 @@ static void* hls_Reload(void *p_this)
         mtime_t now = mdate();
         if (now >= p_sys->playlist.wakeup)
         {
-            /* reload the m3u8 if there are less than 2 segments what aren't downloaded */
-            if ( ( p_sys->download.segment - p_sys->playback.segment < 2 ) &&
+            /* reload the m3u8 if there are less than 3 segments what aren't downloaded */
+            if ( ( p_sys->download.segment - p_sys->playback.segment < 3 ) &&
                  ( hls_ReloadPlaylist(s) != VLC_SUCCESS) )
             {
                 /* No change in playlist, then backoff */