From 897d5c3a4296f3da80b8699d1487328ca2de8e55 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 22 Oct 2014 16:15:02 +0200 Subject: lavf: Print a warning if failed to avoid negative timestamps when requested MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/mux.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libavformat/mux.c') diff --git a/libavformat/mux.c b/libavformat/mux.c index 1e80e105d7..87220ecd63 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -341,6 +341,14 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) pkt->dts += offset; if (pkt->pts != AV_NOPTS_VALUE) pkt->pts += offset; + + if (pkt->dts != AV_NOPTS_VALUE && pkt->dts < 0) { + av_log(s, AV_LOG_WARNING, + "Packets poorly interleaved, failed to avoid negative " + "timestamp %"PRId64" in stream %d.\n" + "Try -max_interleave_delta 0 as a possible workaround.\n", + pkt->dts, pkt->stream_index); + } } ret = s->oformat->write_packet(s, pkt); -- cgit v1.2.3