[vlc-devel] [PATCH 1/3] fix video playback when width and height differ from coded_width and coded_height

Vittorio Giovara vittorio.giovara at gmail.com
Mon Jul 15 18:00:27 CEST 2013


---
 modules/codec/avcodec/video.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index a6a9ab7..50d0a82 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -125,8 +125,14 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
 
-    p_dec->fmt_out.video.i_width = p_context->width;
-    p_dec->fmt_out.video.i_height = p_context->height;
+    if( p_context->coded_width != p_context->width ||
+        p_context->coded_height != p_context->height )
+    {
+        p_dec->fmt_out.video.i_visible_width = p_context->width;
+        p_dec->fmt_out.video.i_visible_height = p_context->height;
+    }
+    p_dec->fmt_out.video.i_width = p_context->coded_width;
+    p_dec->fmt_out.video.i_height = p_context->coded_height;
 
     if( !p_context->width || !p_context->height )
     {
-- 
1.7.9.5




More information about the vlc-devel mailing list