diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-19 00:31:09 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-02-19 02:07:12 +0100 |
commit | 3206ea4ba31ebf446a3c4f1220adb895b3272c15 (patch) | |
tree | 9ac0d8fabc86a1e8e5fdce16305c4c6a83fe3c07 /libavformat | |
parent | 3f28caf72083231131ee35ebc81be2c4dfe95e11 (diff) | |
download | ffmpeg-streaming-3206ea4ba31ebf446a3c4f1220adb895b3272c15.zip ffmpeg-streaming-3206ea4ba31ebf446a3c4f1220adb895b3272c15.tar.gz |
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: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 0711310..37d7024 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -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) |