summaryrefslogtreecommitdiffstats
path: root/libavformat/mp3dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-05 00:50:26 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-05 01:05:16 +0100
commit7546ac2fee40570aa6235cf04329bafdbbb449a4 (patch)
treeeef977c12e8c45d38e7648d505c14dbc034c0c19 /libavformat/mp3dec.c
parent22fa50d15938ffd6ebba7d711407ad3b08e616e0 (diff)
downloadffmpeg-streaming-7546ac2fee40570aa6235cf04329bafdbbb449a4.zip
ffmpeg-streaming-7546ac2fee40570aa6235cf04329bafdbbb449a4.tar.gz
avformat/mp3dec: fix start time in light of initial skip samples
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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 5d484e9..c1ce173 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -165,6 +165,10 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
mp3->start_pad = v>>12;
mp3-> end_pad = v&4095;
st->skip_samples = mp3->start_pad + 528 + 1;
+ if (!st->start_time)
+ st->start_time = av_rescale_q(st->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);
}
}
OpenPOWER on IntegriCloud