]> git.sesse.net Git - vlc/commitdiff
mediacodec: fix width/height in case crop is invalid
authorThomas Guillem <thomas@gllm.fr>
Fri, 14 Nov 2014 16:10:10 +0000 (17:10 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 15 Nov 2014 11:27:05 +0000 (12:27 +0100)
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
modules/codec/omxil/android_mediacodec.c

index 4aba3c901c4412d3162df9ac35f80c3aac858873..574bebe56ea563d31f5599e3eb1293898590a3c8 100644 (file)
@@ -837,6 +837,14 @@ static void GetOutput(decoder_t *p_dec, JNIEnv *env, picture_t **pp_pic, jlong t
 
             p_dec->fmt_out.video.i_width = crop_right + 1 - crop_left;
             p_dec->fmt_out.video.i_height = crop_bottom + 1 - crop_top;
+            if (p_dec->fmt_out.video.i_width <= 1
+                || p_dec->fmt_out.video.i_height <= 1) {
+                p_dec->fmt_out.video.i_width = width;
+                p_dec->fmt_out.video.i_height = height;
+            }
+            p_dec->fmt_out.video.i_visible_width = p_dec->fmt_out.video.i_width;
+            p_dec->fmt_out.video.i_visible_height = p_dec->fmt_out.video.i_height;
+
             if (p_sys->stride <= 0)
                 p_sys->stride = width;
             if (p_sys->slice_height <= 0)