[Android] [PATCH] jni: do not prevent thumbnailing of large videos (e.g. 4K).

Felix Abecassis felix.abecassis at gmail.com
Wed Nov 20 15:50:26 CET 2013


Bump upper bound on video dimension to 4096x2304, this format is used by some 4K cameras and thus many samples are using this resolution.
---
 vlc-android/jni/thumbnailer.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/vlc-android/jni/thumbnailer.c b/vlc-android/jni/thumbnailer.c
index 2d41a59..d139120 100644
--- a/vlc-android/jni/thumbnailer.c
+++ b/vlc-android/jni/thumbnailer.c
@@ -34,6 +34,10 @@
 
 #define THUMBNAIL_POSITION 0.5
 #define PIXEL_SIZE 4 /* RGBA */
+#define THUMBNAIL_MIN_WIDTH 32
+#define THUMBNAIL_MAX_WIDTH 4096
+#define THUMBNAIL_MIN_HEIGHT 32
+#define THUMBNAIL_MAX_HEIGHT 2304
 
 
 /*
@@ -206,7 +210,8 @@ jbyteArray Java_org_videolan_libvlc_LibVLC_getThumbnail(JNIEnv *env, jobject thi
         goto end;
     }
 
-    if( videoWidth < 32 || videoHeight < 32 || videoWidth > 2048 || videoWidth > 2048 )
+    if( videoWidth < THUMBNAIL_MIN_WIDTH || videoHeight < THUMBNAIL_MIN_HEIGHT
+        || videoWidth > THUMBNAIL_MAX_WIDTH || videoHeight > THUMBNAIL_MAX_HEIGHT )
     {
         LOGE("Wrong video dimensions.\n");
         goto end;
-- 
1.8.3.2



More information about the Android mailing list