[libav-commits] lavf: Print a warning if failed to avoid negative timestamps when requested

Michael Niedermayer git at libav.org
Fri Nov 7 11:17:09 CET 2014


Module: libav
Branch: master
Commit: 897d5c3a4296f3da80b8699d1487328ca2de8e55

Author:    Michael Niedermayer <michaelni at gmx.at>
Committer: Martin Storsjö <martin at martin.st>
Date:      Wed Oct 22 16:15:02 2014 +0200

lavf: Print a warning if failed to avoid negative timestamps when requested

Signed-off-by: Martin Storsjö <martin at martin.st>

---

 libavformat/mux.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 1e80e10..87220ec 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);
 



More information about the libav-commits mailing list