diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index efbf836bcc..b044679c02 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -260,6 +260,10 @@ static void mp3_parse_info_tag(AVFormatContext *s, AVStream *st, st->first_discard_sample = -mp3->end_pad + 528 + 1 + mp3->frames * (int64_t)spf; st->last_discard_sample = mp3->frames * (int64_t)spf; } + if (!st->start_time) + st->start_time = av_rescale_q(st->start_skip_samples, + (AVRational){1, c->sample_rate}, + st->time_base); av_log(s, AV_LOG_DEBUG, "pad %d %d\n", mp3->start_pad, mp3-> end_pad); } diff --git a/tests/ref/fate/gapless-mp3 b/tests/ref/fate/gapless-mp3 index e784391153..ab4f1a0456 100644 --- a/tests/ref/fate/gapless-mp3 +++ b/tests/ref/fate/gapless-mp3 @@ -1,4 +1,4 @@ -ec876434ed65e338e07234e54d136caf *tests/data/fate/gapless-mp3.out-1 +44b42cc3a898b45507d856d0813f4f26 *tests/data/fate/gapless-mp3.out-1 c96c3ae7bd3300fd2f4debac222de5b7 ec876434ed65e338e07234e54d136caf *tests/data/fate/gapless-mp3.out-2 c96c3ae7bd3300fd2f4debac222de5b7