[vlc-devel] [PATCH 19/19] mediacodec: fix width/height in case crop is invalid

Thomas Guillem thomas at gllm.fr
Fri Nov 14 17:10:10 CET 2014


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




More information about the vlc-devel mailing list