summaryrefslogtreecommitdiffstats
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-22 16:15:02 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-22 16:28:49 +0200
commitec6a5fc6cca22e4eb0a91cc8fba786d41ade2032 (patch)
tree3774e3f96a92eb4595103e01a85942f0317be8c9 /libavformat/mux.c
parentad5c43bb36b0d3615bb5f9c8ebf626038abb384a (diff)
downloadffmpeg-streaming-ec6a5fc6cca22e4eb0a91cc8fba786d41ade2032.zip
ffmpeg-streaming-ec6a5fc6cca22e4eb0a91cc8fba786d41ade2032.tar.gz
avformat/mux: Fix assertion failure due to max_interleave_delta and poor input
Fixes Ticket4051 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index f29d731..5e45bd8 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -574,7 +574,15 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
if (pkt->pts != AV_NOPTS_VALUE)
pkt->pts += offset;
- av_assert2(pkt->dts == AV_NOPTS_VALUE || pkt->dts >= 0);
+ av_assert2(pkt->dts == AV_NOPTS_VALUE || pkt->dts >= 0 || s->max_interleave_delta > 0);
+ if (pkt->dts != AV_NOPTS_VALUE && pkt->dts < 0) {
+ av_log(s, AV_LOG_WARNING,
+ "Packets poorly interleaved, failed to avoid negative timestamp %s in stream %d\n"
+ "try -max_interleave_delta 0 as a possible workaround\n",
+ av_ts2str(pkt->dts),
+ pkt->stream_index
+ );
+ }
}
did_split = av_packet_split_side_data(pkt);
OpenPOWER on IntegriCloud