[vlc-commits] streamfilter/httplive.c: UpdatePlaylist() actually lock segment when updating it.

Jean-Paul Saman git at videolan.org
Wed Jan 18 17:37:41 CET 2012


vlc | branch: master | Jean-Paul Saman <jean-paul.saman at m2x.nl> | Tue Jan 10 12:14:00 2012 +0100| [2ada723d2ad9682c7532690462ca4791b3290899] | committer: Jean-Paul Saman

streamfilter/httplive.c: UpdatePlaylist() actually lock segment when updating it.

When an already existing segment is updated, then make sure it to take the lock.

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

 modules/stream_filter/httplive.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
index fb7ca70..d17f061 100644
--- a/modules/stream_filter/httplive.c
+++ b/modules/stream_filter/httplive.c
@@ -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
         {



More information about the vlc-commits mailing list