[vlc-commits] avcodec: pass aligned picture dimensions to video output

Rémi Denis-Courmont git at videolan.org
Sun Sep 1 11:37:21 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Aug 31 18:45:32 2013 +0300| [fa6218de7ceef86581f575844c3e7ce1e55d1ee4] | committer: Rémi Denis-Courmont

avcodec: pass aligned picture dimensions to video output

This enables direct rendering for H.264 software decoding.

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

 modules/codec/avcodec/video.c |   21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 958f9ea..db573d0 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -126,20 +126,23 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
                                             AVCodecContext *p_context )
 {
     decoder_sys_t *p_sys = p_dec->p_sys;
+    int aligns[AV_NUM_DATA_POINTERS];
+    int width = p_context->coded_width;
+    int height = p_context->coded_height;
+
+    avcodec_align_dimensions2(p_context, &width, &height, aligns);
+
+    if( width == 0 || height == 0)
+        return NULL; /* invalid display size */
+
+    p_dec->fmt_out.video.i_width = width;
+    p_dec->fmt_out.video.i_height = height;
 
-    if( p_context->coded_width != p_context->width ||
-        p_context->coded_height != p_context->height )
+    if( width != p_context->width || 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 )
-    {
-        return NULL; /* invalid display size */
-    }
 
     if( !p_sys->p_va && GetVlcChroma( &p_dec->fmt_out.video, p_context->pix_fmt ) )
     {



More information about the vlc-commits mailing list