summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-04 22:37:51 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-05-04 23:59:26 +0200
commit1f95ad48ff158ac3a7419efc98e9153a4fac1dc6 (patch)
tree913ed8a7ccfa1525a4eb9d0d5faf03f297014fe1 /libavcodec
parent9f357e2bcdea20d16c7771eff183414e375d0c7a (diff)
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vorbis_parser.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/vorbis_parser.c b/libavcodec/vorbis_parser.c
index f8d92e04d0..d1f083874e 100644
--- a/libavcodec/vorbis_parser.c
+++ b/libavcodec/vorbis_parser.c
@@ -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