diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-02-24 18:04:05 -0500 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-03-03 16:43:11 -0500 |
commit | 737ca4482bd68d6dc52a1811f5de8e4952ad7036 (patch) | |
tree | 1336218e8943f52608a25f61e7cbe305b07abdde /libavcodec | |
parent | 7fb6c9225c309c55b85f6974627e26976817bff5 (diff) | |
download | ffmpeg-737ca4482bd68d6dc52a1811f5de8e4952ad7036.tar.gz |
vorbisdec: read the previous window flag for long windows
When reading sequentially, we are using the actual flag from the previous
frame, but when seeking we do not know what the previous window flag was, so
we need to read it from the bitstream.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/vorbisdec.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index d3f6faff69..c83d49dbba 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -1510,8 +1510,10 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) blockflag = vc->modes[mode_number].blockflag; blocksize = vc->blocksize[blockflag]; vlen = blocksize / 2; - if (blockflag) - skip_bits(gb, 2); // previous_window, next_window + if (blockflag) { + previous_window = get_bits(gb, 1); + skip_bits1(gb); // next_window + } memset(ch_res_ptr, 0, sizeof(float) * vc->audio_channels * vlen); //FIXME can this be removed ? memset(ch_floor_ptr, 0, sizeof(float) * vc->audio_channels * vlen); //FIXME can this be removed ? |