mpv/osdep
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
..
android android: posix_spawn(p) replacement 2017-09-22 09:24:19 +02:00
ar HIDRemote: fix volume buttons on macOS 10.13 2018-04-17 20:10:17 +03:00
macos cocoa-cb: remove get_property_* usages and split up mpv helper 2019-10-06 13:29:48 +02:00
win32 win32: fix massive memory corruption (take 2) 2017-08-21 18:42:04 +02:00
atomic.h demux: support for some kinds of timed metadata 2018-04-18 01:17:42 +03:00
compiler.h osdep: add portable C11-like alignof() macro 2018-05-24 19:56:35 +02:00
endian.h
getpid.h lua+js: Implement utils.getpid() 2018-02-13 20:16:01 -08:00
glob-win.c
io.c io: remove Windows tmpfile() emulation 2019-09-19 20:37:05 +02:00
io.h player: Optionally validate st_mtime when restoring playback state 2019-11-20 15:11:33 +01:00
macOS_swift_bridge.h cocoa-cb: add support for VOCTRL_GET_DISPLAY_NAMES 2019-02-10 22:39:25 +02:00
macosx_application.h cocoa-cb: add support for 10bit opengl rendering 2019-09-26 00:02:02 +02:00
macosx_application.m cocoa-cb: add support for 10bit opengl rendering 2019-09-26 00:02:02 +02:00
macosx_application_objc.h cocoa-cb: remove pre-allocation of window, view and layer 2018-06-12 01:51:01 +03:00
macosx_compat.h mac: add missing semicolon to macosx_compat.h 2019-01-26 20:44:36 +01:00
macosx_events.h osx: code cleanups and cosmetic fixes 2018-01-20 14:43:49 -08:00
macosx_events.m macosx_events: fix crash when shutting down during window animations 2019-03-13 19:44:34 +01:00
macosx_events_objc.h osx: code cleanups and cosmetic fixes 2018-01-20 14:43:49 -08:00
macosx_menubar.h osx: move menu bar creation into its own file 2017-08-18 19:20:41 +02:00
macosx_menubar.m mac: add Open Playlist menu bar item 2019-09-23 19:28:38 +02:00
macosx_menubar_objc.h osx: refactor menu bar creation 2017-08-18 19:20:41 +02:00
macosx_touchbar.h
macosx_touchbar.m
macosx_versions.h
main-fn-cocoa.c
main-fn-unix.c
main-fn-win.c win32: remove -municode from mpv binary 2019-09-19 20:37:05 +02:00
main-fn.h
mpv.exe.manifest
mpv.rc mpv.rc: readd actual version info 2018-01-01 21:44:01 +00:00
path-macosx.m osx: fix bundle on macOS High Sierra (10.13) 2017-10-03 11:30:56 +02:00
path-unix.c
path-uwp.c
path-win.c
path.h
polldev.c osdep: add poll shim for macOS 2017-12-09 21:11:46 +02:00
polldev.h osdep: add poll shim for macOS 2017-12-09 21:11:46 +02:00
posix-spawn.h osdep: make use of HAVE_ANDROID 2018-08-20 17:16:22 +02:00
semaphore.h
semaphore_osx.c
strnlen.h osdep: make use of HAVE_ANDROID 2018-08-20 17:16:22 +02:00
subprocess-dummy.c
subprocess-posix.c misc: move mp_cancel from stream.c to thread_tools.c 2018-05-24 19:56:35 +02:00
subprocess-win.c misc: move mp_cancel from stream.c to thread_tools.c 2018-05-24 19:56:35 +02:00
subprocess.c
subprocess.h
terminal-dummy.c
terminal-unix.c terminal-unix: stop trying to read when terminal disappears 2018-05-25 10:17:06 +02:00
terminal-win.c
terminal.h
threads.c
threads.h
timer-darwin.c
timer-linux.c build: remove nanosleep() check 2017-12-02 23:29:40 +01:00
timer-win2.c
timer.c timer: remove an unused helper function 2018-05-24 19:56:35 +02:00
timer.h demux, stream: readd cache-speed in some other form 2018-12-06 10:30:41 +01:00
w32_keyboard.c w32_common: handle media keys 2017-08-05 02:38:44 +10:00
w32_keyboard.h w32_common: handle media keys 2017-08-05 02:38:44 +10:00
win32-console-wrapper.c win32-console-wrapper: silence missing prototype warnings 2019-05-10 21:06:58 +10:00
windows_utils.c
windows_utils.h