diff options
author | wm4 <wm4@nowhere> | 2019-12-14 14:17:16 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2019-12-14 14:17:16 +0100 |
commit | 57fbc9cd76f7a78f1034c42dd3c453ff35123264 (patch) | |
tree | 0b614f61fe877478ede41336c9e3f55389ba04f7 /osdep/getpid.h | |
parent | 23c5965d47d7ceac234d25100263d4e3d0efc133 (diff) | |
download | mpv-57fbc9cd76f7a78f1034c42dd3c453ff35123264.tar.bz2 mpv-57fbc9cd76f7a78f1034c42dd3c453ff35123264.tar.xz |
player: make repeated hr-seeks past EOF trigger EOF as expected
If you have a normal file with audio and video, and keep "spamming"
forward hr-seeks, the player just kept showing the last video frame
instead of exiting or playing the next file. This started happening
since commit 6bcda94cb. Although not a bug per se, it was odd, and very
user-noticable.
The main problem was that the pending seek command was processed before
the EOF was "noticed". Processing the command reset everything, so the
player did not terminate playback, but repeated the seek.
This commit restores the old behavior.
For one, it makes video return the correct status (video.c). The
parameter is a bit ugly, but better than duplicating the logic or having
another MPContext field. (As a minor detail, setting r=VD_EOF makes sure
have_new_frame() returns true, rather than going through another
iteration or whatever the hell will happen instead, which would clobber
logical_eof.)
Another thing is making the seek logic actually wait until the seek
outcome has been determined if audio is also active. Audio needs to wait
for video in order to get the video seek target position. (Which in turn
is because hr-seek still "snaps" to video frames. You can't seek in
between two frames, so audio can't just use the seek target, but always
has to wait on the timestamp of the video frame. This has other
disadvantages and is a misdesign, but not something I'll fix today.)
In theory, this might make hr-seeks less responsive, because it needs to
fully decode/filter the audio too, but in practice most time is spent on
video, which had to be fully decoded before this change. (In general,
hr-seek could probably just show a random frame when a queued hr-seek
overrides the current hr-seek, which would probably lead to a better
user experience, but that's out of scope.)
Fixes: #7206
Diffstat (limited to 'osdep/getpid.h')
0 files changed, 0 insertions, 0 deletions