1
0
mirror of https://github.com/mpv-player/mpv synced 2025-03-11 08:37:59 +00:00

demux: add missing seekpoint when cached ranges are joined

The impact was that you couldn't exactly seek to the join point with a
keyframe seek, even though there was a keyframe. This commit fixes it by
preserving the necessary metadata that got lost on cached range joining.

This is so absurdly obscure that it gets a longer code comment.
This commit is contained in:
wm4 2018-01-09 21:37:14 +01:00 committed by Kevin Mitchell
parent 2d345c59d6
commit 4a11c28237

View File

@ -999,6 +999,14 @@ static void attempt_range_joining(struct demux_internal *in)
goto failed;
}
// q1 usually meets q2 at a keyframe. q1 will end on a key-
// frame (because it tries joining when reading a keyframe).
// Obviously, q1 can not know the kf_seek_pts yet; it would
// have to read packets after it to compute it. Ideally,
// we'd remove it and use q2's packet, but the linked list
// makes this hard, so copy this missing metadata instead.
end->kf_seek_pts = dp->kf_seek_pts;
remove_head_packet(q2);
join_point_found = true;
break;