changeset 1263:9fce515e9894 libavcodec

libmpeg2 style bitstream reader 17 vs 16 bit bugfix
author michaelni
date Wed, 14 May 2003 22:38:58 +0000
parents 82e0e1b9c283
children 2fa34e615c76
files common.c common.h
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/common.c	Wed May 14 17:46:55 2003 +0000
+++ b/common.c	Wed May 14 22:38:58 2003 +0000
@@ -162,7 +162,7 @@
     {
         OPEN_READER(re, s)
         UPDATE_CACHE(re, s)
-//        UPDATE_CACHE(re, s)
+        UPDATE_CACHE(re, s)
         CLOSE_READER(re, s)
     }
 #ifdef A32_BITSTREAM_READER
--- a/common.h	Wed May 14 17:46:55 2003 +0000
+++ b/common.h	Wed May 14 22:38:58 2003 +0000
@@ -546,7 +546,7 @@
 #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 @@
 #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;\