[vlc-commits] Android vout: fix possible mutex leak.

Thomas Guillem git at videolan.org
Sun Jun 29 23:26:09 CEST 2014


vlc/vlc-2.2 | branch: master | Thomas Guillem <guillem at archos.com> | Thu Jun 26 14:05:51 2014 +0200| [b51c39c22514d2c0c8e2aaaf5c7153e0d3668699] | committer: Jean-Baptiste Kempf

Android vout: fix possible mutex leak.

Do not leak mutex if i_chroma is VLC_CODEC_ANDROID_OPAQUE.

Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit 3d90771a7b113a554ddda9f3ea98ac137f5c9dcc)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=b51c39c22514d2c0c8e2aaaf5c7153e0d3668699
---

 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);



More information about the vlc-commits mailing list