[vlc-devel] [RFC PATCH 03/13] Android vout: fix possible mutex leak.

Martin Storsjö martin at martin.st
Sun Jun 29 22:12:43 CEST 2014


On Thu, 26 Jun 2014, Thomas Guillem wrote:

> Do not leak mutex if i_chroma is VLC_CODEC_ANDROID_OPAQUE.
> ---
> modules/video_output/android/surface.c |    9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/modules/video_output/android/surface.c b/modules/video_output/android/surface.c
> index 6aaa9ef..f6a183e 100644
> --- a/modules/video_output/android/surface.c
> +++ b/modules/video_output/android/surface.c
> @@ -173,6 +173,10 @@ static void *InitLibrary(vout_display_sys_t *sys)
> static int Open(vlc_object_t *p_this)
> {
>     vout_display_t *vd = (vout_display_t *)p_this;
> +    video_format_t fmt = vd->fmt;
> +
> +    if (fmt.i_chroma == VLC_CODEC_ANDROID_OPAQUE)
> +        return VLC_EGENERIC;
>
>     /* */
>     if (vlc_mutex_trylock(&single_instance) != 0) {
> @@ -200,11 +204,6 @@ static int Open(vlc_object_t *p_this)
>     }
>
>     /* Setup chroma */
> -    video_format_t fmt = vd->fmt;
> -
> -    if (fmt.i_chroma == VLC_CODEC_ANDROID_OPAQUE)
> -        return VLC_EGENERIC;
> -
>     char *psz_fcc = var_InheritString(vd, CFG_PREFIX "chroma");
>     if( psz_fcc ) {
>         fmt.i_chroma = vlc_fourcc_GetCodecFromString(VIDEO_ES, psz_fcc);
> -- 
> 1.7.10.4

Ok, pushed.

// Martin



More information about the vlc-devel mailing list