From 962d63157322466a9a82f9f9d84c1b6f1b582f65 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 27 May 2014 10:28:24 +0200 Subject: matroskaenc: set the stream timebase earlier Fixes calculating the ts offset for audio codecs with delay. --- libavformat/matroskaenc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libavformat/matroskaenc.c') diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 0a3775daea..f6af0f8324 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -620,6 +620,9 @@ static int mkv_write_tracks(AVFormatContext *s) int output_sample_rate = 0; AVDictionaryEntry *tag; + // ms precision is the de-facto standard timescale for mkv files + avpriv_set_pts_info(st, 64, 1, 1000); + if (codec->codec_type == AVMEDIA_TYPE_ATTACHMENT) { mkv->have_attachments = 1; continue; @@ -759,9 +762,6 @@ static int mkv_write_tracks(AVFormatContext *s) if (ret < 0) return ret; end_ebml_master(pb, track); - - // ms precision is the de-facto standard timescale for mkv files - avpriv_set_pts_info(st, 64, 1, 1000); } end_ebml_master(pb, tracks); return 0; -- cgit v1.2.3