oggvorbisdec: redesign special handling of first frames timestamp.

This also will make it possible to use the code for cases other than the start of a stream

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2012-05-04 22:37:51 +02:00
parent 9f357e2bcd
commit 1f95ad48ff
2 changed files with 15 additions and 9 deletions

View File

@@ -226,7 +226,8 @@ int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,
previous_blocksize = s->blocksize[flag];
}
current_blocksize = s->mode_blocksize[mode];
duration = (previous_blocksize + current_blocksize) >> 2;
if(previous_blocksize)
duration = (previous_blocksize + current_blocksize) >> 2;
s->previous_blocksize = current_blocksize;
}
@@ -236,7 +237,7 @@ int avpriv_vorbis_parse_frame(VorbisParseContext *s, const uint8_t *buf,
void avpriv_vorbis_parse_reset(VorbisParseContext *s)
{
if (s->valid_extradata)
s->previous_blocksize = s->mode_blocksize[0];
s->previous_blocksize = 0;
}
#if CONFIG_VORBIS_PARSER