When an already existing segment is updated, then make sure it to take the lock.
assert(p->url.psz_path);
assert(segment->url.psz_path);
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) ||
/* they should be the same */
if ((p->sequence != segment->sequence) ||
(p->duration != segment->duration) ||
segment_Free(p);
free(psz_url);
}
segment_Free(p);
free(psz_url);
}
+
+ vlc_mutex_unlock(&segment->lock);