aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorClément Bœsch <clement.boesch@smartjog.com>2012-10-10 14:32:43 +0200
committerClément Bœsch <ubitux@gmail.com>2012-10-15 09:19:21 +0200
commitb08273c9ca8b91d03133f9fbef100bbd3cd8e271 (patch)
tree2095bcba3e83fed042e6de5d53975740eb5abe50 /libavformat
parent304c37b216d77a0159651d9a6044ea9612e11762 (diff)
downloadffmpeg-b08273c9ca8b91d03133f9fbef100bbd3cd8e271.tar.gz
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."
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/matroskaenc.c3
1 files changed, 3 insertions, 0 deletions
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);