Commit c228c356 authored by Laurent Aimar's avatar Laurent Aimar

Check for codec specific pitches alignment in avcodec.

 It is ugly to have this list of codec id (as it can become unsynchronized), but
ffmpeg does not provide a way to retreive this information :(
parent c935a03f
...@@ -948,7 +948,20 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context, ...@@ -948,7 +948,20 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
b_compatible = false; b_compatible = false;
for( int i = 0; i < p_pic->i_planes && b_compatible; i++ ) for( int i = 0; i < p_pic->i_planes && b_compatible; i++ )
{ {
const unsigned i_align = i == 0 ? 16 : 8; unsigned i_align;
switch( p_sys->i_codec_id )
{
case CODEC_ID_SVQ1:
case CODEC_ID_VP5:
case CODEC_ID_VP6:
case CODEC_ID_VP6F:
case CODEC_ID_VP6A:
i_align = 16;
break;
default:
i_align = i == 0 ? 16 : 8;
break;
}
if( p_pic->p[i].i_pitch % i_align ) if( p_pic->p[i].i_pitch % i_align )
b_compatible = false; b_compatible = false;
if( (intptr_t)p_pic->p[i].p_pixels % i_align ) if( (intptr_t)p_pic->p[i].p_pixels % i_align )
......
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