demux: fix seek range caching with delay_open hack

These have ->segmented set (so the codec can be initialized properly),
but have no segment start or end times. This code was (probably) the
only thing which didn't handle this case.
This commit is contained in:
wm4 2020-02-20 15:11:46 +01:00
parent f321d8da99
commit 0020b47ffd
1 changed files with 2 additions and 1 deletions

View File

@ -1844,7 +1844,8 @@ static struct demux_packet *compute_keyframe_times(struct demux_packet *pkt,
break;
double ts = MP_PTS_OR_DEF(pkt->pts, pkt->dts);
if (pkt->segmented && (ts < pkt->start || ts > pkt->end))
if (pkt->segmented && ((pkt->start != MP_NOPTS_VALUE && ts < pkt->start) ||
(pkt->end != MP_NOPTS_VALUE && ts > pkt->end)))
ts = MP_NOPTS_VALUE;
min = MP_PTS_MIN(min, ts);