]> git.sesse.net Git - vlc/commitdiff
avcodec: align dimensions only for software decoding
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 5 Sep 2013 16:14:32 +0000 (19:14 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 5 Sep 2013 16:14:51 +0000 (19:14 +0300)
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.

modules/codec/avcodec/video.c

index db573d0489781a42640e834ae7d85bab77b71c3f..9622a944f8e9a955ebd3b555fb1a345191aa5dd6 100644 (file)
@@ -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 */