[vlc-devel] [PATCH 26/48] hls: Only reload the current playlist

Hugo Beauzée-Luyssen beauze.h at gmail.com
Mon Jan 9 16:16:35 CET 2012


From: Luc Saillard <luc.saillard at sfr.com>

---
 modules/stream_filter/httplive.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index 44a1409..89e2d27 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1382,13 +1382,18 @@ static int hls_ReloadPlaylist(stream_t *s)
     if (hls_streams == NULL)
         return VLC_ENOMEM;
 
-    int count = vlc_array_count(p_sys->hls_stream);
-    for (int n = p_sys->playback.stream; n < count; n++)
+    //int count = vlc_array_count(p_sys->hls_stream);
+    //for (int n = p_sys->playback.stream; n < count; n++)
+    int n = p_sys->playback.stream;
     {
         int err;
         hls_stream_t *hls = vlc_array_item_at_index(p_sys->hls_stream, n);
         if (!hls)
-            continue;
+        {
+            msg_Err(s, "This playlist doesn't exist ??? how this can be possible (playlist number %d)", n );
+            msg_Err(s, "We need to download a new playlist");
+            return VLC_ENOMEM;
+        }
 
         /* create a fake stream, so get_HTTPLivePlaylist() can updated it */
         hls_stream_t *hls_new = hls_New(hls_streams, hls->id, hls->bandwidth, hls->uri);
-- 
1.7.8.3




More information about the vlc-devel mailing list