From e9cef89702e2bde918102e784c6b75a7979e85d1 Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 26 May 2011 20:19:04 +0200 Subject: avformat: Add a flag to mark muxers that allow (non strict) monotone timestamps. Signed-off-by: Justin Ruggles --- libavformat/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libavformat/utils.c') diff --git a/libavformat/utils.c b/libavformat/utils.c index e8430b23fa..438752174e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2962,7 +2962,9 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){ pkt->dts= st->pts_buffer[0]; } - if(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && st->cur_dts >= pkt->dts){ + if (st->cur_dts && st->cur_dts != AV_NOPTS_VALUE && + ((!(s->oformat->flags & AVFMT_TS_NONSTRICT) && + st->cur_dts >= pkt->dts) || st->cur_dts > pkt->dts)) { av_log(s, AV_LOG_ERROR, "Application provided invalid, non monotonically increasing dts to muxer in stream %d: %"PRId64" >= %"PRId64"\n", st->index, st->cur_dts, pkt->dts); -- cgit v1.2.3