mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avformat/mux: Check for and remove invalid packet durations
Fixes assertion failure Fixes Ticket3575 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
b9017fdd42
commit
dc6a17cf74
@ -435,6 +435,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_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);
|
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 */
|
/* duration field */
|
||||||
if (pkt->duration == 0) {
|
if (pkt->duration == 0) {
|
||||||
ff_compute_frame_duration(&num, &den, st, NULL, pkt);
|
ff_compute_frame_duration(&num, &den, st, NULL, pkt);
|
||||||
|
Loading…
Reference in New Issue
Block a user