[vlc-devel] [PATCH 18/48] hls: Add missing lock segment ready
Jean-Paul Saman
jpsaman at videolan.org
Tue Jan 10 14:33:04 CET 2012
I agree this patch cannot be correct.
2012/1/10 Rémi Denis-Courmont <remi at remlab.net>:
> On Mon, 9 Jan 2012 16:16:27 +0100, Hugo Beauzée-Luyssen
> <beauze.h at gmail.com> wrote:
>> From: Luc Saillard <luc.saillard at sfr.com>
>>
>> ---
>> modules/stream_filter/httplive.c | 6 ++++--
>> 1 files changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/modules/stream_filter/httplive.c
>> b/modules/stream_filter/httplive.c
>> index a7089b6..606f2f4 100644
>> --- a/modules/stream_filter/httplive.c
>> +++ b/modules/stream_filter/httplive.c
>> @@ -2103,17 +2103,19 @@ static segment_t *GetSegment(stream_t *s)
>> {
>> vlc_mutex_lock(&hls->lock);
>> segment = segment_GetSegment(hls, p_sys->playback.segment);
>> + vlc_mutex_unlock(&hls->lock);
>> if (segment != NULL)
>> {
>> /* This segment is ready? */
>> + vlc_mutex_lock(&segment->lock);
>> if (segment->data != NULL)
>> {
>> p_sys->b_cache = hls->b_cache;
>> - vlc_mutex_unlock(&hls->lock);
>> + vlc_mutex_unlock(&segment->lock);
>> goto check;
>> }
>> + vlc_mutex_unlock(&segment->lock);
>> }
>> - vlc_mutex_unlock(&hls->lock);
>> }
>
> I have not checked the details of segment_GetSegment() but this patch
> looks a lot like it is *introducing* the race condition that it claims to
> fix.
>
>>
>> /* Was the HLS stream changed to another bitrate? */
>
> --
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list