From 03a0e8336a89e686f4274121bc86987398e8c71c Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 25 Oct 2017 16:13:07 +0200 Subject: [PATCH] demux: fall back to DTS when determining seek target Fixes AVI in particular, which abuses DTS for reordered PTS. (It's not really DTS...) --- demux/demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demux/demux.c b/demux/demux.c index bf0b53f939..492f704876 100644 --- a/demux/demux.c +++ b/demux/demux.c @@ -571,7 +571,7 @@ static double recompute_keyframe_target_pts(struct demux_packet *dp) in_keyframe_range = true; } if (in_keyframe_range) { - double ts = dp->pts; + double ts = PTS_OR_DEF(dp->pts, dp->dts); if (dp->segmented && (ts < dp->start || ts > dp->end)) ts = MP_NOPTS_VALUE; res = MP_PTS_MIN(res, ts);