]> git.sesse.net Git - ffmpeg/commitdiff
get_bits: Return pointer to buffer that is the result of the alignment
authorRonald S. Bultje <rsbultje@gmail.com>
Mon, 11 Feb 2013 00:46:07 +0000 (16:46 -0800)
committerMartin Storsjö <martin@martin.st>
Tue, 19 Feb 2013 20:33:52 +0000 (22:33 +0200)
This allows more transparent mixing of get_bits and whole-byte access
without having to touch get_bits internals.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec/get_bits.h

index ddac5d76d58f33d4b173f68c3f4e24817ad11af4..5a0089add8aaa662c01c544706153124fa27f4fa 100644 (file)
@@ -413,11 +413,12 @@ static inline int init_get_bits8(GetBitContext *s, const uint8_t *buffer,
     return init_get_bits(s, buffer, byte_size * 8);
 }
 
-static inline void align_get_bits(GetBitContext *s)
+static inline const uint8_t *align_get_bits(GetBitContext *s)
 {
     int n = -get_bits_count(s) & 7;
     if (n)
         skip_bits(s, n);
+    return s->buffer + (s->index >> 3);
 }
 
 #define init_vlc(vlc, nb_bits, nb_codes,                \