diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h
index ed8c8fcdd1a25627faa7f0a52a15b80cc3fdc266..bb0eb0c490dbbe436c0671ec02f0de973c9edd66 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
 }