summaryrefslogtreecommitdiffstats
path: root/DOCS/man/options.rst
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-05-27 01:24:22 +0200
committerwm4 <wm4@nowhere>2019-09-19 20:37:05 +0200
commit7a0f112a448df1d0390d53a3169606cad4ee6589 (patch)
tree8e22f7a0d4c1afb9286d1e1fbc21fde35123d97d /DOCS/man/options.rst
parent6f9059f85838dccea278402bad7e94cb254af594 (diff)
downloadmpv-7a0f112a448df1d0390d53a3169606cad4ee6589.tar.bz2
mpv-7a0f112a448df1d0390d53a3169606cad4ee6589.tar.xz
player: modify/simplify AB-loop behavior
This changes the behavior of the --ab-loop-a/b options. In addition, it makes it work with backward playback mode. The most obvious change is that the both the A and B point need to be set now before any looping happens. Unlike before, unset points don't implicitly use the start or end of the file. I think the old behavior was a feature that was explicitly added/wanted. Well, it's gone now. This is because of 2 reasons: 1. I never liked this feature, and it always got in my way (as user). 2. It's inherently annoying with backward playback mode. In backward playback mode, the user wants to set A/B in the wrong order. The ab-loop command will first set A, then B, so if you use this command during backward playback, A will be set to a higher timestamps than B. If you switch back to forward playback mode, the loop would stop working. I want the loop to just continue to work, and the chosen solution conflicts with the removed feature. The order issue above _could_ be fixed by also switching the AB-loop user option values around on direction switch. But there are no other instances of option changes magically affecting other options, and doing this would probably lead to unexpected misery (dying from corner cases and such). Another solution is sorting the A/B points by timestamps after copying them from the user options. Then A/B options set in backward mode will work in forward mode. This is the chosen solution. If you sort the points, you don't know anymore whether the unset point is supposed to signify the end or the start of the file. The AB-loop code is slightly better abstracted now, so it should be easy to restore the removed feature. It would still require coming up with a solution for backwards playback, though. A minor change is that if one point is set and the other is unset, I'm rendering both the chapter markers and the marker for the set point. Why? I don't know. My test file had chapters, and I guess I decided this looked better. This commit also fixes some subtle and obvious issues that I already forgot about when I wrote this commit message. It cleans up some minor code duplication and nonsense too. Regarding backward playback, the code uses an unsanitary mix of internal ("transformed") and user timestamps. So the play_dir variable appears more than usual. To mention one unfixed issue: if you set an AB-loop that is completely past the end of the file, it will get stuck in an infinite seeking loop once playback reaches the end of the file. Fixing this reliably seemed annoying, so the fix is "just don't do this". It's not a hard freeze anyway.
Diffstat (limited to 'DOCS/man/options.rst')
-rw-r--r--DOCS/man/options.rst11
1 files changed, 8 insertions, 3 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index 775a937c1e..6da1b58b6c 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -314,9 +314,14 @@ Playback Control
the ``a`` timestamp. Seeking past the ``b`` point doesn't loop (this is
intentional).
- If both options are set to ``no`` or unset, looping is disabled.
- Otherwise, the start/end of playback is used if one of the options
- is set to ``no`` or unset.
+ If ``a`` is after ``b``, the behavior is as if the points were given in
+ the right order, and the player will seek to ``b`` after crossing through
+ ``a``. This is different from old behavior, where looping was disabled (and
+ as a bug, looped back to ``a`` on the end of the file).
+
+ If either options are set to ``no`` (or unset), looping is disabled. This
+ is different from old behavior, where an unset ``a`` implied the start of
+ the file, and an unset ``b`` the end of the file.
The loop-points can be adjusted at runtime with the corresponding
properties. See also ``ab-loop`` command.