summaryrefslogtreecommitdiff
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-05-27 10:28:24 +0200
committerAnton Khirnov <anton@khirnov.net>2014-05-29 08:01:58 +0200
commit962d63157322466a9a82f9f9d84c1b6f1b582f65 (patch)
tree8d6085202bb55a25fbea08f375ef2b41caa848a2 /libavformat/matroskaenc.c
parent43e7f0797f9f821a3866a20f05e512e13c82076a (diff)
matroskaenc: set the stream timebase earlier
Fixes calculating the ts offset for audio codecs with delay.
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c6
1 files changed, 3 insertions, 3 deletions
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;