0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 03:52:22 +02:00

player: replace a magic numer by another magic number

This code attempts to seek to the last frame by seeking close to the
end, and then decoding until the last frame has been reached. To do so
it sets hrseek_lastframe, which for video enables some logic to "catch"
this last frame, and completely ignores hrseek_pts. But audio still may
use hrseek_pts

I don't know if the original author (me) was thinking, if anything, when
setting this variable to 1e99, essentially a random, number. It's very
large, and a timestamp like this will never happen, so it does its job.
But it's random.

Use INFINITY instead. It will skip all audio samples in the audio code
correctly. This change doesn't fix anything, but it does get rid of the
random looking number.
This commit is contained in:
wm4 2019-05-26 14:03:06 +02:00
parent 2363e15eee
commit 6f9059f858

View File

@ -847,7 +847,7 @@ void seek_to_last_frame(struct MPContext *mpctx)
});
// Make it exact: stop seek only if last frame was reached.
if (mpctx->hrseek_active) {
mpctx->hrseek_pts = 1e99; // "infinite"
mpctx->hrseek_pts = INFINITY;
mpctx->hrseek_lastframe = true;
}
}