vlc/vlc-2.1 | branch: master | Ilkka Ollakka <[email protected]> | Mon Aug 26 
16:08:56 2013 +0300| [fb7f3c252fc234a232343b8194d93d440b1cc807] | committer: 
Jean-Baptiste Kempf

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).

(cherry picked from commit 7655d6c889d2425c1fd4615f7e2692df1a47470c)
Signed-off-by: Jean-Baptiste Kempf <[email protected]>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.1.git/?a=commit;h=fb7f3c252fc234a232343b8194d93d440b1cc807
---

 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 6f186f4..9105a0b 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1705,14 +1705,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++;
@@ -1730,7 +1731,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

Reply via email to