mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
fixing get_bits_count at the end
Originally committed as revision 638 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
7fd08ac1d1
commit
c9b5489c08
@ -174,6 +174,9 @@ unsigned int get_bits_long(GetBitContext *s, int n)
|
|||||||
(buf_ptr[-2] << 8) |
|
(buf_ptr[-2] << 8) |
|
||||||
(buf_ptr[-1]);
|
(buf_ptr[-1]);
|
||||||
#endif
|
#endif
|
||||||
|
val |= bit_buf >> (32 + bit_cnt);
|
||||||
|
bit_buf <<= - bit_cnt;
|
||||||
|
bit_cnt += 32;
|
||||||
} else {
|
} else {
|
||||||
buf_ptr -= 4;
|
buf_ptr -= 4;
|
||||||
bit_buf = 0;
|
bit_buf = 0;
|
||||||
@ -185,11 +188,13 @@ unsigned int get_bits_long(GetBitContext *s, int n)
|
|||||||
bit_buf |= *buf_ptr++ << 8;
|
bit_buf |= *buf_ptr++ << 8;
|
||||||
if (buf_ptr < s->buf_end)
|
if (buf_ptr < s->buf_end)
|
||||||
bit_buf |= *buf_ptr++;
|
bit_buf |= *buf_ptr++;
|
||||||
|
|
||||||
|
val |= bit_buf >> (32 + bit_cnt);
|
||||||
|
bit_buf <<= - bit_cnt;
|
||||||
|
bit_cnt += 8*(buf_ptr - s->buf_ptr);
|
||||||
|
if(bit_cnt<0) bit_cnt=0;
|
||||||
}
|
}
|
||||||
s->buf_ptr = buf_ptr;
|
s->buf_ptr = buf_ptr;
|
||||||
val |= bit_buf >> (32 + bit_cnt);
|
|
||||||
bit_buf <<= - bit_cnt;
|
|
||||||
bit_cnt += 32;
|
|
||||||
}
|
}
|
||||||
s->bit_buf = bit_buf;
|
s->bit_buf = bit_buf;
|
||||||
s->bit_cnt = bit_cnt;
|
s->bit_cnt = bit_cnt;
|
||||||
|
Loading…
Reference in New Issue
Block a user