Closed monkeylugs closed 2 months ago
This error comes from libmpv, and is just bubbled up by python-mpv. Looking at mpv's source code, mpv's documentation on the playlist-next
and playlist-prev
commands is a bit unclear. The meaning of weak
versus force
is that force
will terminate playback, i.e. stop the file that is currently playing, if it is at the end of the playlist, while weak
will leave it playing. However, in either case, libmpv will report a "command" error. See the source here for reference.
You can safely ignore this error with a try: ... except SystemError: pass
in your python code.
Not sure if this is just my incompetence but whilst trying to understand the difference between idle=True and keep_open=True I came across a SystemError
The error - (mpv doesn't crash despite the error)
Traceback (most recent call last): File "/home/mark/python_stuff/mpv/./mpv_test_basic.py", line 33, in
player.playlist_next()
File "/home/mark/python_stuff/mpv_1_0_6.py", line 1315, in playlist_next
self.command('playlist_next', mode)
File "/home/mark/python_stuff/mpv_1_0_6.py", line 1229, in command
_mpv_command_node(self.handle, ppointer, out)
File "/home/mark/python_stuff/mpv_1_0_6.py", line 142, in raise_for_ec
raise ex
SystemError: ('Error running mpv command', -12, (<MpvHandle object at 0x7ed75d77ca70>, <mpv_1_0_6.LP_MpvNode object at 0x7ed75d16c170>, <mpv_1_0_6.LP_MpvNode object at 0x7ed75d16c0e0>))
An example to replicate the error -
This came up when experimenting with keybindings with the default key bindings disabled, i'd bound keys to playlist_next() and playlist_prev() as this gave an obvious way to show the key bindings were working. Interestingly using the default key bindings of < & > to move through a playlist the error isn't triggered.
My rudimentary understanding of the source code suggests that playlist_next() default mode = weak, so advancing beyond the ends of the playlist should be pretty much ignored.
Apologies if I'm just doing something stupid