Commit 6f98d4ba authored by Rémi Denis-Courmont's avatar 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.
parent afac3fec
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment