1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-29 02:22:19 +00:00
mpv/player
wm4 a11aad4964 player: partially fix seek_to_last_frame in backward mode
Another shitty obscure feature that usually nobody notices.
Unsurprisingly, it doesn't go well with backward playback mode.

If you use --keep-open in forward playback mode, and seek past the end
of the file, it tries to seek to the very last frame. The demuxer will
seek to the last "keyframe" before the end (i.e. some frames to go in
most cases), and trying to hr-seek to the file duration often won't cut
it, so this requires some special code. The function at hand seeks
"close" to the end, and then stops hr-seek when the last frame us
encountered (simple enough and very effective).

In backward playback mode, start and end are reversed, and we need to
seek "close" to the start of the file instead. Simple enough to do, and
it works.

One problem is that command.c has some weird logic to make going beyond
the last chapter either end playback (--keep-open=no), or jump to the
last frame. Now this will jump to the first frame, which is weird, but
let's ignore this.

Another problem is that seeking before playback start position hits EOF
in backward playback mode, which is a demuxer bug, and has nothing to do
with this code. But it triggers this code, so seeking before the start
will show the "last" frame. (My description is a mess with directions.
Figure it out yourself.)
2019-09-19 20:37:05 +02:00
..
javascript js: expose mpv_abort_async_command() (match dbe831bd) 2019-09-11 21:08:04 +03:00
lua demux_edl, cue, mkv: clean up timeline stuff slightly 2019-09-19 20:37:04 +02:00
audio.c player: fix --end for backwards playback 2019-09-19 20:37:04 +02:00
client.c client: fix potential mpv_cmd/async leak 2019-07-08 16:42:47 +02:00
client.h command: add infrastructure for async commands 2018-05-24 19:56:34 +02:00
command.c player: modify/simplify AB-loop behavior 2019-09-19 20:37:05 +02:00
command.h command: add a way to abort asynchronous commands 2018-05-24 19:56:34 +02:00
configfiles.c Remove optical disc fancification layers 2019-09-13 17:31:59 +02:00
core.h player: fix --loop with backward playback 2019-09-19 20:37:05 +02:00
external_files.c external_files: add .lrc subtitle extension 2019-09-02 01:25:43 +03:00
external_files.h player: get rid of mpv_global.opts 2018-05-24 19:56:35 +02:00
javascript.c js: expose mpv_abort_async_command() (match dbe831bd) 2019-09-11 21:08:04 +03:00
loadfile.c player: fix --loop with backward playback 2019-09-19 20:37:05 +02:00
lua.c lua: expose mpv_abort_async_command() 2018-05-24 19:56:34 +02:00
main.c Implement backwards playback 2019-09-19 20:37:04 +02:00
misc.c player: fix --loop with backward playback 2019-09-19 20:37:05 +02:00
osd.c player: modify/simplify AB-loop behavior 2019-09-19 20:37:05 +02:00
playloop.c player: partially fix seek_to_last_frame in backward mode 2019-09-19 20:37:05 +02:00
screenshot.c image_writer: move convert_image() to player/screenshot.c 2019-09-14 23:02:39 +02:00
screenshot.h image_writer: move convert_image() to player/screenshot.c 2019-09-14 23:02:39 +02:00
scripting.c scripting: change when/how player waits for scripts being loaded 2018-04-18 01:17:41 +03:00
sub.c sub: fix typo in comment 2019-09-19 20:37:04 +02:00
video.c player: fix --end for backwards playback 2019-09-19 20:37:04 +02:00