1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avformat/demux: add support to derive timestamps from packet durations for video

This commit is contained in:
Paul B Mahol 2023-05-21 02:15:26 +02:00
parent a1838c59bb
commit e7cadd0ee5

View File

@ -1195,6 +1195,11 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
st->time_base,
AV_ROUND_DOWN);
}
} else if ((s->iformat->flags & AVFMT_NOTIMESTAMPS) && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
if (st->time_base.num > 0 && st->time_base.den > 0 &&
sti->parser->duration) {
out_pkt->duration = sti->parser->duration;
}
}
out_pkt->stream_index = st->index;