diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-08-26 11:37:33 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-08-26 11:37:33 +0000 |
commit | a42ec9f48468d5b1aca7ff25fc1b90ef5deaccfe (patch) | |
tree | 0c6e0cb34b485cfa80bfc5f5ae9546b0c1bcff51 /libavcodec/bitstream.h | |
parent | 3dddf21fcc8b4fc7fcd13bb0928c114df5842381 (diff) | |
download | ffmpeg-a42ec9f48468d5b1aca7ff25fc1b90ef5deaccfe.tar.gz |
make A32 reader align its ptr during init no matter what missaligned mess is given to it
Originally committed as revision 6096 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/bitstream.h')
-rw-r--r-- | libavcodec/bitstream.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h index ed8c8fcdd1..bb0eb0c490 100644 --- a/libavcodec/bitstream.h +++ b/libavcodec/bitstream.h @@ -719,20 +719,16 @@ static inline void init_get_bits(GetBitContext *s, s->bit_count = 16; s->cache = 0; } -#elif defined A32_BITSTREAM_READER - s->buffer_ptr = (uint32_t*)buffer; - s->bit_count = 32; - s->cache0 = 0; - s->cache1 = 0; -#endif { OPEN_READER(re, s) UPDATE_CACHE(re, s) UPDATE_CACHE(re, s) CLOSE_READER(re, s) } -#ifdef A32_BITSTREAM_READER - s->cache1 = 0; +#elif defined A32_BITSTREAM_READER + s->buffer_ptr = (uint32_t*)((intptr_t)buffer&(~3)); + s->bit_count = 32 + 8*((intptr_t)buffer&3); + skip_bits_long(s, 0); #endif } |