summaryrefslogtreecommitdiff
path: root/libavformat/mp3dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-08 22:08:37 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-06-08 22:08:37 +0200
commit49e766aa4c3d2d754bc202b87d762b041e50a449 (patch)
treefe819a79dd337dfb22a14084a6541aa8dcb96928 /libavformat/mp3dec.c
parent4f33a9803a3068ce2d52289fc1db60375dc8b7a5 (diff)
Revert "lavf/mp3dec: don't adjust start time; packets are not adjusted."
This causes regressions in end to end timestamps with mp3s and ffmpeg. The revert is to avoid this regression in the 4.3 release See: [FFmpeg-devel] [PATCH] Don't adjust start time for MP3 files; packets are not adjusted. This reverts commit 460132c9980f8a1f501a1f69477bca49e1641233.
Diffstat (limited to 'libavformat/mp3dec.c')
-rw-r--r--libavformat/mp3dec.c4
1 files changed, 4 insertions, 0 deletions
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);
}