aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/common.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2003-05-14 22:38:58 +0000
committerMichael Niedermayer <michaelni@gmx.at>2003-05-14 22:38:58 +0000
commit3bb10888ff7a845efa30fd64d5978a8708db01d7 (patch)
tree7dc447da53380150cc54ed61c2688afed7250793 /libavcodec/common.h
parent41fda91d097b85542981a4779e36f8eefda7ee69 (diff)
downloadffmpeg-3bb10888ff7a845efa30fd64d5978a8708db01d7.tar.gz
libmpeg2 style bitstream reader 17 vs 16 bit bugfix
Originally committed as revision 1881 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/common.h')
-rw-r--r--libavcodec/common.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/common.h b/libavcodec/common.h
index 092026d78e..874b15cda4 100644
--- a/libavcodec/common.h
+++ b/libavcodec/common.h
@@ -546,7 +546,7 @@ static inline int get_bits_count(GetBitContext *s){
#elif defined LIBMPEG2_BITSTREAM_READER
//libmpeg2 like reader
-# define MIN_CACHE_BITS 16
+# define MIN_CACHE_BITS 17
# define OPEN_READER(name, gb)\
int name##_bit_count=(gb)->bit_count;\
@@ -570,7 +570,7 @@ static inline int get_bits_count(GetBitContext *s){
#else
# define UPDATE_CACHE(name, gb)\
- if(name##_bit_count > 0){\
+ if(name##_bit_count >= 0){\
name##_cache+= ((name##_buffer_ptr[0]<<8) + name##_buffer_ptr[1]) << name##_bit_count;\
name##_buffer_ptr+=2;\
name##_bit_count-= 16;\