[FFmpeg-cvslog] matroskadec: Improve TTA duration calculation

James Almer git at videolan.org
Mon Aug 26 23:58:48 CEST 2013


ffmpeg | branch: release/0.11 | James Almer <jamrial at gmail.com> | Sat Aug 17 14:48:33 2013 -0300| [c4470471174cb9447fb7556023b36926685be2a8] | committer: James Almer

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 at gmail.com>
Approved-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit af248fa1174200acb537a6ab1198bb2fed38e884)

Conflicts:
	libavformat/matroskadec.c

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c4470471174cb9447fb7556023b36926685be2a8
---

 libavformat/matroskadec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 129de90..6e0e880 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1615,7 +1615,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 == CODEC_ID_RV10 || codec_id == CODEC_ID_RV20 ||
                    codec_id == CODEC_ID_RV30 || codec_id == CODEC_ID_RV40) {
             extradata_offset = 26;



More information about the ffmpeg-cvslog mailing list