mpv/player
Chris Down e143966a76 player: Optionally validate st_mtime when restoring playback state
I often watch sporting events. On many occasions I get files with the
same filename for each session. For example, for F1 I might have the
following directory structure:

    F1/
        FP1.mkv
        FP2.mkv
        FP3.mkv
        Qualification.mkv
        Race.mkv

Since usually one simply watches one race after the other, I usually
just rsync the new event's files over the old ones, so, for example,
Race.mkv will be replaced from the file for the last event with the file
from the new event.

One problem with this is that I like to use --resume-playback for other
kinds of media, so I have it on by default. That works great for, say, a
movie, but doesn't work so well with this scheme, because you can
trivially forget to pass --no-resume-playback on the command line and
end up 2 hours in, watching spoilers as the race results scroll down the
screen :-)

This patch adds a new option, --resume-playback-check-mtime, which
validates that the file's mtime hasn't changed since the watch_later
configuration was saved. It does this by setting the watch_later
configuration to have the same mtime as the file after it is saved.

Switching back and forth between checking mtime and not checking mtime
works fine, as we only choose whether to compare based on it, but we
update the watch_later configuration mtime regardless of its value.
2019-11-20 15:11:33 +01:00
..
javascript js: expose mpv_abort_async_command() (match dbe831bd) 2019-09-11 21:08:04 +03:00
lua lua: report key name for "complex" key bindings 2019-11-19 23:11:05 +01:00
audio.c player: remove some unnecessary coverart special cases 2019-11-17 02:11:45 +01:00
client.c player: remove mechanisms for better logging with repl.lua 2019-11-18 00:44:54 +01:00
client.h client API: remove unused global event mask 2019-10-24 16:27:24 +02:00
command.c options: remove M_SETOPT_RUNTIME 2019-11-10 23:53:57 +01:00
command.h demux, command: add a third stream recording mechanism 2019-09-19 20:37:05 +02:00
configfiles.c player: Optionally validate st_mtime when restoring playback state 2019-11-20 15:11:33 +01:00
core.h options: deprecate --video-sync=display-adrop 2019-11-17 02:11:45 +01: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: don't pre-filter log level argument in mp.enable_messages() 2019-11-19 18:13:39 +02:00
loadfile.c player: remove mechanisms for better logging with repl.lua 2019-11-18 00:44:54 +01:00
lua.c lua: don't pre-filter log level argument in mp.enable_messages() 2019-11-18 00:44:54 +01:00
main.c player: remove mechanisms for better logging with repl.lua 2019-11-18 00:44:54 +01:00
misc.c player: simplify --stream-dump code 2019-10-31 11:05:55 +01:00
osd.c player: format low cache duration with more decimals 2019-10-11 19:18:43 +02:00
playloop.c player: remove some unnecessary coverart special cases 2019-11-17 02:11:45 +01:00
screenshot.c screenshot, vo_image: use global swscale/zimg parameters 2019-10-31 15:44:09 +01:00
screenshot.h screenshot, vo_image: use global swscale/zimg parameters 2019-10-31 15:44:09 +01:00
scripting.c scripting: change when/how player waits for scripts being loaded 2018-04-18 01:17:41 +03:00
sub.c player: ensure backward playback state is propagated on track switching 2019-09-19 20:37:05 +02:00
video.c options: deprecate --video-sync=display-adrop 2019-11-17 02:11:45 +01:00