[vlc-commits] android surface: check error when locking the video playback surface

Felix Abecassis git at videolan.org
Sun Jun 29 23:26:09 CEST 2014


vlc/vlc-2.2 | branch: master | Felix Abecassis <felix.abecassis at gmail.com> | Mon Jun 23 19:21:41 2014 +0200| [50dc263245f68430ddf1599a661e5fefcd1ed9cc] | committer: Jean-Baptiste Kempf

android surface: check error when locking the video playback surface

(cherry picked from commit 713ab83f6a19057634e4c9b9c758ca397ebfc8e3)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/video_output/android/surface.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/modules/video_output/android/surface.c b/modules/video_output/android/surface.c
index 139511d..6aaa9ef 100644
--- a/modules/video_output/android/surface.c
+++ b/modules/video_output/android/surface.c
@@ -388,7 +388,11 @@ static int  AndroidLockSurface(picture_t *picture)
 
     if (sys->native_window.winLock) {
         ANativeWindow_Buffer buf = { 0 };
-        sys->native_window.winLock(sys->window, &buf, NULL);
+        int32_t err = sys->native_window.winLock(sys->window, &buf, NULL);
+        if (err) {
+            jni_UnlockAndroidSurface();
+            return VLC_EGENERIC;
+        }
         info->w      = buf.width;
         info->h      = buf.height;
         info->bits   = buf.bits;



More information about the vlc-commits mailing list