]> git.sesse.net Git - vlc/commitdiff
stream_filter/httplive.c: signal download thread on successfull index reload (live...
authorJean-Paul Saman <jean-paul.saman@m2x.nl>
Wed, 5 Oct 2011 13:48:43 +0000 (15:48 +0200)
committerJean-Paul Saman <jean-paul.saman@m2x.nl>
Mon, 10 Oct 2011 12:28:13 +0000 (14:28 +0200)
Make sure the download thread will continue when an new index file for
this stream has been successfully loaded.

modules/stream_filter/httplive.c

index e809a7baab9ba63bf0f217a4402cb4c4eee4c30e..a409c40e8d76ea56308a9946faee59662d25886b 100644 (file)
@@ -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);