diff options
author | James Almer <jamrial@gmail.com> | 2013-08-17 14:48:33 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2013-08-25 19:41:55 -0300 |
commit | 77783c7114ab2720f065aa2474b252121a5a1d11 (patch) | |
tree | 249dbc9dfe48ed80040c79f630bd4be026ed42cd /libavformat/matroskadec.c | |
parent | 979f97a86127371fef7cda7521e01a8b20243c21 (diff) | |
download | ffmpeg-77783c7114ab2720f065aa2474b252121a5a1d11.tar.gz |
matroskadec: Improve TTA duration calculation
Calculate the duration as accurately as possible to improve decoding of samples
where the last frame is smaller than the rest.
Signed-off-by: James Almer <jamrial@gmail.com>
Approved-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit af248fa1174200acb537a6ab1198bb2fed38e884)
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index fe4b70cd73..de9b58f719 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1673,7 +1673,7 @@ static int matroska_read_header(AVFormatContext *s) avio_wl16(&b, track->audio.channels); avio_wl16(&b, track->audio.bitdepth); avio_wl32(&b, track->audio.out_samplerate); - avio_wl32(&b, matroska->ctx->duration * track->audio.out_samplerate); + avio_wl32(&b, av_rescale((matroska->duration * matroska->time_scale), track->audio.out_samplerate, AV_TIME_BASE * 1000)); } else if (codec_id == AV_CODEC_ID_RV10 || codec_id == AV_CODEC_ID_RV20 || codec_id == AV_CODEC_ID_RV30 || codec_id == AV_CODEC_ID_RV40) { extradata_offset = 26; |