Commit 1e39f64c authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Jean-Baptiste Kempf

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.
(cherry picked from commit 2ada723d)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent f023ff2a
...@@ -1065,6 +1065,8 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t * ...@@ -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(p->url.psz_path);
assert(segment->url.psz_path); assert(segment->url.psz_path);
vlc_mutex_lock(&segment->lock);
/* they should be the same */ /* they should be the same */
if ((p->sequence != segment->sequence) || if ((p->sequence != segment->sequence) ||
(p->duration != segment->duration) || (p->duration != segment->duration) ||
...@@ -1091,6 +1093,8 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t * ...@@ -1091,6 +1093,8 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
segment_Free(p); segment_Free(p);
free(psz_url); free(psz_url);
} }
vlc_mutex_unlock(&segment->lock);
} }
else else
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment