diff options
author | James Almer <jamrial@gmail.com> | 2013-08-17 14:48:33 -0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-26 04:51:06 +0200 |
commit | 9865f19f15ba05b87c58027b81c2edc193cb283b (patch) | |
tree | 88f10a4ef742b33728dd8f65aea394808a0877d5 | |
parent | 90ed77019285938176ace29ab3ad90261048f7df (diff) | |
download | ffmpeg-9865f19f15ba05b87c58027b81c2edc193cb283b.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)
-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 be30f9326e..2590a71481 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1690,7 +1690,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; |