[vlc-commits] avcodec: align dimensions only for software decoding

Rémi Denis-Courmont git at videolan.org
Thu Sep 5 18:15:48 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Sep  5 19:14:32 2013 +0300| [6f98d4ba651e63d92670f6eea93d7636772e913a] | committer: Rémi Denis-Courmont

avcodec: align dimensions only for software decoding

There is no use to CPU memory edges when decoding in hardware (arguably
libavcodec should be "enhanced" to not add them in that case).
This unbreaks VDPAU.

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

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

diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index db573d0..9622a94 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -126,11 +126,15 @@ 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( p_sys->p_va == NULL )
+    {
+        int aligns[AV_NUM_DATA_POINTERS];
+
+        avcodec_align_dimensions2(p_context, &width, &height, aligns);
+    }
 
     if( width == 0 || height == 0)
         return NULL; /* invalid display size */



More information about the vlc-commits mailing list