summaryrefslogtreecommitdiffstats
path: root/demux
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-10-08 21:26:17 +0200
committerwm4 <wm4@nowhere>2019-10-08 21:26:43 +0200
commit68bbc55eda2de7d54ebbad394b8eb6994f3fdeef (patch)
tree47b7861f0c3b458f048b55bdeaf980e659802a53 /demux
parent0a30a4a432e3405a94222806675f6076819cabfc (diff)
downloadmpv-68bbc55eda2de7d54ebbad394b8eb6994f3fdeef.tar.bz2
mpv-68bbc55eda2de7d54ebbad394b8eb6994f3fdeef.tar.xz
skip-logo.lua: fix skipping in the first two frames
mpv typically decodes and filters at least 2 frames before starting playback. This happens during seeks, as well as when playback starts from the beginning of the file. skip-logo.lua receives notifications for all filtered frames, even during seeking. It should interrupt during seeking, so as a crude heuristic, it ignored all frames while the player was seeking. This does not mean all these frames are skipped due to seeking (thus it's a "crude hueristic"). In particular, it means that the first 2 frames of a video cannot be skipped, since they're filtered within the playback restart phase (equivalent to "seeking"). Fix this by making the heuristic slightly less crude. Since we observe the property as "none", the property is not actually read until we do it explicitly. By not reading it during seeking, we can let the frames internally queue up (vf_fingerprint discards them in a ringbuffer-like fashion if they're too many). Then, if seeking ends, we get the current playback timestamp, and check queued up frames that are at or after that timestamp. (In some ways, this duplicates what the player's seeking logic does.) A disadvantage is that this is racy. While playback-time is guaranteed to be set when seeking changes from false to true, playback could already have progressed to the next frame (or more) before the script gets time to react. In theory, we could add a seek restart hook or so, but I don't want to. A property that returns the last playback restart time would also do it, but feels to special. Not an important problem in practice anyway.
Diffstat (limited to 'demux')
0 files changed, 0 insertions, 0 deletions