]> git.sesse.net Git - vlc/commitdiff
streamfilter/httplive.c: UpdatePlaylist() actually lock segment when updating it.
authorJean-Paul Saman <jean-paul.saman@m2x.nl>
Tue, 10 Jan 2012 11:14:00 +0000 (12:14 +0100)
committerJean-Paul Saman <jean-paul.saman@m2x.nl>
Wed, 18 Jan 2012 14:19:24 +0000 (15:19 +0100)
When an already existing segment is updated, then make sure it to take the lock.

modules/stream_filter/httplive.c

index fb7ca700df10b0b539983843ab1c7818295e83b1..d17f061bd4c88278ef979ba2f4d1445f3281afa0 100644 (file)
@@ -1065,6 +1065,8 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
             assert(p->url.psz_path);
             assert(segment->url.psz_path);
 
+            vlc_mutex_lock(&segment->lock);
+
             /* they should be the same */
             if ((p->sequence != segment->sequence) ||
                 (p->duration != segment->duration) ||
@@ -1091,6 +1093,8 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
                 segment_Free(p);
                 free(psz_url);
             }
+
+            vlc_mutex_unlock(&segment->lock);
         }
         else
         {