mkvmuxer: Disallow non-monotonically increasing timestamps.

Segment::AddFrame will now return false (fail) when a non-monotonically
increasing timestamp value is passed to the method.

Change-Id: Icfac093e6bddf18e3ef252df79e35c33dbe1e134
This commit is contained in:
Tom Finegan
2012-01-20 15:59:38 -05:00
parent d2327e2b65
commit 7a9a72f984

View File

@@ -1575,6 +1575,10 @@ bool Segment::AddFrame(const uint8* frame,
if (!CheckHeaderInfo())
return false;
// Check for non-monotonically increasing timestamps.
if (timestamp < last_timestamp_)
return false;
// If the segment has a video track hold onto audio frames to make sure the
// audio that is associated with the start time of a video key-frame is
// muxed into the same cluster.