mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
avformat/mp3dec: read xing toc independant of usetoc, only skip filling index if requested
Fixes hypothetical parsing bug with -usetoc 0 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
a71832f826
commit
4cc32e5cad
@ -94,9 +94,6 @@ static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration
|
|||||||
int i;
|
int i;
|
||||||
MP3DecContext *mp3 = s->priv_data;
|
MP3DecContext *mp3 = s->priv_data;
|
||||||
|
|
||||||
if (!mp3->usetoc)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!filesize &&
|
if (!filesize &&
|
||||||
!(filesize = avio_size(s->pb))) {
|
!(filesize = avio_size(s->pb))) {
|
||||||
av_log(s, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n");
|
av_log(s, AV_LOG_WARNING, "Cannot determine file size, skipping TOC table.\n");
|
||||||
@ -105,7 +102,7 @@ static void read_xing_toc(AVFormatContext *s, int64_t filesize, int64_t duration
|
|||||||
|
|
||||||
for (i = 0; i < XING_TOC_COUNT; i++) {
|
for (i = 0; i < XING_TOC_COUNT; i++) {
|
||||||
uint8_t b = avio_r8(s->pb);
|
uint8_t b = avio_r8(s->pb);
|
||||||
|
if (mp3->usetoc)
|
||||||
av_add_index_entry(s->streams[0],
|
av_add_index_entry(s->streams[0],
|
||||||
av_rescale(b, filesize, 256),
|
av_rescale(b, filesize, 256),
|
||||||
av_rescale(i, duration, XING_TOC_COUNT),
|
av_rescale(i, duration, XING_TOC_COUNT),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user