Commit 4cc32e5c authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mp3dec: read xing toc independant of usetoc, only skip filling index if requested

Fixes hypothetical parsing bug with -usetoc 0
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent a71832f8
......@@ -94,9 +94,6 @@ static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration
int i;
MP3DecContext *mp3 = s->priv_data;
if (!mp3->usetoc)
return;
if (!filesize &&
!(filesize = avio_size(s->pb))) {
av_log(s, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n");
......@@ -105,8 +102,8 @@ static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration
for (i = 0; i < XING_TOC_COUNT; i++) {
uint8_t b = avio_r8(s->pb);
av_add_index_entry(s->streams[0],
if (mp3->usetoc)
av_add_index_entry(s->streams[0],
av_rescale(b, filesize, 256),
av_rescale(i, duration, XING_TOC_COUNT),
0, 0, AVINDEX_KEYFRAME);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment