[vlc-devel] [vlc-commits] hls: Fixing some locks.

Hugo Beauzée-Luyssen beauze.h at gmail.com
Tue Jan 24 15:44:42 CET 2012


On Mon, Jan 23, 2012 at 9:52 PM, Hugo Beauzée-Luyssen <git at videolan.org> wrote:
> vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Mon Jan 23 16:45:28 2012 +0100| [bcbad8c70e309d03ec7dac57ee1f146f41948574] | committer: Jean-Baptiste Kempf
>
> hls: Fixing some locks.
>
> Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
>
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bcbad8c70e309d03ec7dac57ee1f146f41948574
> ---
>
>  modules/stream_filter/httplive.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/modules/stream_filter/httplive.c b/modules/stream_filter/httplive.c
> index 458d338..76e6093 100644
> --- a/modules/stream_filter/httplive.c
> +++ b/modules/stream_filter/httplive.c
> @@ -1360,11 +1360,11 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
>         segment_t *segment = segment_Find(*hls, p->sequence);
>         if (segment)
>         {
> +            vlc_mutex_lock(&segment->lock);
> +
>             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) ||
> @@ -1382,6 +1382,7 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
>                 {
>                     msg_Err(s, "Failed updating segment %d - skipping it",  p->sequence);
>                     segment_Free(p);
> +                    vlc_mutex_unlock(&segment->lock);
>                     continue;
>                 }
>                 segment->sequence = p->sequence;
> @@ -1396,11 +1397,10 @@ static int hls_UpdatePlaylist(stream_t *s, hls_stream_t *hls_new, hls_stream_t *
>                 }
>                 free(segment->psz_key_path);
>                 segment->psz_key_path = p->psz_key_path ? strdup(p->psz_key_path) : NULL;
> +                vlc_mutex_unlock(&segment->lock);
>                 segment_Free(p);
>                 free(psz_url);
>             }
> -
> -            vlc_mutex_unlock(&segment->lock);
>         }
>         else
>         {
>

This commit is wrong, badly...
My apologies. The attached patch fixes it.


-- 
Hugo Beauzée-Luyssen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-hls-Fixing-a-deadlock-introduced-in-previous-commit.patch
Type: text/x-patch
Size: 1029 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20120124/b566290d/attachment.bin>


More information about the vlc-devel mailing list