From b08273c9ca8b91d03133f9fbef100bbd3cd8e271 Mon Sep 17 00:00:00 2001 From: Clément Bœsch Date: Wed, 10 Oct 2012 14:32:43 +0200 Subject: lavf/mkv: avoid negative ts by default. This fixes playback in some circumstances (like webm in firefox). Regression after 2c34367b. It is also matching the Matroska specifications: http://matroska.org/technical/specs/notes.html, "The quick eye will notice that if a Cluster's Timecode is set to zero, it is possible to have Blocks with a negative Raw Timecode. Blocks with a negative Raw Timecode are not valid." --- libavformat/matroskaenc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavformat/matroskaenc.c') diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 375f728e61..bcded7c060 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -902,6 +902,9 @@ static int mkv_write_header(AVFormatContext *s) if (!strcmp(s->oformat->name, "webm")) mkv->mode = MODE_WEBM; else mkv->mode = MODE_MATROSKAv2; + if (s->avoid_negative_ts < 0) + s->avoid_negative_ts = 1; + mkv->tracks = av_mallocz(s->nb_streams * sizeof(*mkv->tracks)); if (!mkv->tracks) return AVERROR(ENOMEM); -- cgit v1.2.3