[vlc-commits] mediacodec: fix width/height in case crop is invalid

Thomas Guillem git at videolan.org
Sat Nov 15 12:27:24 CET 2014


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Nov 14 17:10:10 2014 +0100| [a34f2273a1a10b05128a758a7771efe82682df74] | committer: Jean-Baptiste Kempf

mediacodec: fix width/height in case crop is invalid

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/omxil/android_mediacodec.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index 4aba3c9..574bebe 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -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)



More information about the vlc-commits mailing list