[vlc-devel] commit: Check for codec specific pitches alignment in avcodec. ( Laurent Aimar )
git version control
git at videolan.org
Fri Feb 26 21:00:31 CET 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Fri Feb 26 20:36:29 2010 +0100| [c228c356bb5bbac52edf06c0ba9dbdeb48bdb55f] | committer: 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 :(
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c228c356bb5bbac52edf06c0ba9dbdeb48bdb55f
---
modules/codec/avcodec/video.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index 2fda800..c4d443f 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -948,7 +948,20 @@ static int ffmpeg_GetFrameBuf( struct AVCodecContext *p_context,
b_compatible = false;
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 )
b_compatible = false;
if( (intptr_t)p_pic->p[i].p_pixels % i_align )
More information about the vlc-devel
mailing list