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."
This commit is contained in:
Clément Bœsch
2012-10-10 14:32:43 +02:00
committed by Clément Bœsch
parent 304c37b216
commit b08273c9ca
3 changed files with 27 additions and 24 deletions
+3
View File
@@ -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);