avformat/mux: Fix assertion failure due to max_interleave_delta and poor input
Fixes Ticket4051 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
ad5c43bb36
commit
ec6a5fc6cc
@ -574,7 +574,15 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
if (pkt->pts != AV_NOPTS_VALUE)
|
if (pkt->pts != AV_NOPTS_VALUE)
|
||||||
pkt->pts += offset;
|
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);
|
did_split = av_packet_split_side_data(pkt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user