summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-26 14:03:06 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:05 +0200
commit6f9059f85838dccea278402bad7e94cb254af594 (patch)
tree73d857c0063467157bd3e8c340df7ee31d7d153a
parent2363e15eeef4064f95eeec1b487c438b62dc7a02 (diff)
downloadmpv-6f9059f85838dccea278402bad7e94cb254af594.tar.bz2
mpv-6f9059f85838dccea278402bad7e94cb254af594.tar.xz
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.
-rw-r--r--player/playloop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/player/playloop.c b/player/playloop.c
index de02728061..3dafb35f3f 100644
--- a/player/playloop.c
+++ b/player/playloop.c
@@ -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;
}
}