aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-04-23 06:04:50 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-23 18:17:42 +0200
commitc75a915f66f2808c7d545e7b91a9242b9752d3f9 (patch)
treee1c1067c5c30cef4b88222edddf2488d236ae254
parentecd30280f5ef3bd5c087ab5c457d115739717e39 (diff)
downloadffmpeg-c75a915f66f2808c7d545e7b91a9242b9752d3f9.tar.gz
avformat/mux: Check for and remove invalid packet durations
Fixes assertion failure Fixes Ticket3575 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit dc6a17cf74a90e41d70ea1753cdb70c0a5b2ced8) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mux.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 98ec7a4cf2..14c12621aa 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -410,6 +410,12 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
av_dlog(s, "compute_pkt_fields2: pts:%s dts:%s cur_dts:%s b:%d size:%d st:%d\n",
av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), delay, pkt->size, pkt->stream_index);
+ if (pkt->duration < 0 && st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) {
+ av_log(s, AV_LOG_WARNING, "Packet with invalid duration %d in stream %d\n",
+ pkt->duration, pkt->stream_index);
+ pkt->duration = 0;
+ }
+
/* duration field */
if (pkt->duration == 0) {
ff_compute_frame_duration(&num, &den, st, NULL, pkt);