Commit 3206ea4b authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/utils: Also fill dts==RELATIVE_TS_BASE packets in update_initial_durations()

This dts value can end up in the list in the absence of durations and is in that
case semantically identical to AV_NOPTS_VALUE. We can alternatively prevent
storing RELATIVE_TS_BASE if there is no duration.

Fixes Ticket3640
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 3f28caf7
......@@ -1164,8 +1164,11 @@ static void update_initial_durations(AVFormatContext *s, AVStream *st,
for (; pktl; pktl = get_next_pkt(s, st, pktl)) {
if (pktl->pkt.stream_index != stream_index)
continue;
if (pktl->pkt.pts == pktl->pkt.dts &&
(pktl->pkt.dts == AV_NOPTS_VALUE || pktl->pkt.dts == st->first_dts) &&
if ((pktl->pkt.pts == pktl->pkt.dts ||
pktl->pkt.pts == AV_NOPTS_VALUE) &&
(pktl->pkt.dts == AV_NOPTS_VALUE ||
pktl->pkt.dts == st->first_dts ||
pktl->pkt.dts == RELATIVE_TS_BASE) &&
!pktl->pkt.duration) {
pktl->pkt.dts = cur_dts;
if (!st->internal->avctx->has_b_frames)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment