[vlc-commits] stream_filter/httplive.c: signal download thread on successfull index reload (live streams)

Jean-Paul Saman git at videolan.org
Mon Oct 10 14:30:01 CEST 2011


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Wed Oct  5 15:48:43 2011 +0200| [176f95145a9abe736170f8e02ef94720dbf6d4d6] | committer: Jean-Paul Saman

stream_filter/httplive.c: signal download thread on successfull index reload (live streams)

Make sure the download thread will continue when an new index file for
this stream has been successfully loaded.

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

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

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index e809a7b..a409c40 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -1077,9 +1077,20 @@ static int hls_ReloadPlaylist(stream_t *s)
             msg_Info(s, "new HLS stream appended (id=%d, bandwidth=%"PRIu64")",
                      hls_new->id, hls_new->bandwidth);
         }
-        else if (hls_UpdatePlaylist(s, hls_new, &hls_old) != VLC_SUCCESS)
-            msg_Info(s, "failed updating HLS stream (id=%d, bandwidth=%"PRIu64")",
-                     hls_new->id, hls_new->bandwidth);
+        else
+        {
+            if ((hls_UpdatePlaylist(s, hls_new, &hls_old) == VLC_SUCCESS) &&
+                    (s->p_sys->download.stream == n))
+            {
+                /* wake up download thread */
+                vlc_mutex_lock(&s->p_sys->download.lock_wait);
+                vlc_cond_signal(&s->p_sys->download.wait);
+                vlc_mutex_unlock(&s->p_sys->download.lock_wait);
+            }
+            else
+                msg_Info(s, "failed updating HLS stream (id=%d, bandwidth=%"PRIu64")",
+                             hls_new->id, hls_new->bandwidth);
+        }
     }
 
     vlc_array_destroy(hls_streams);



More information about the vlc-commits mailing list