Skip to content

Commit

Permalink
Merge commit '7a4293a'
Browse files Browse the repository at this point in the history
  • Loading branch information
superolmo committed May 22, 2024
2 parents dcd2663 + 7a4293a commit 60a0e15
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion usr/lib/hypnotix/mpv.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ def _mpv_client_api_version():
_mpv_create = backend.mpv_create

_API_VER = _mpv_client_api_version()[0]
_USE_LOADFILE_INDEX = _mpv_client_api_version() >= (2, 3) # libmpv 0.38.0

_handle_func('mpv_destroy' if _API_VER > 1 else 'mpv_detach_destroy', [], None, errcheck=None)
_handle_func('mpv_create_client', [c_char_p], MpvHandle, notnull_errcheck)
Expand Down Expand Up @@ -1148,7 +1149,10 @@ def _encode_options(options):

def loadfile(self, filename, mode='replace', **options):
"""Mapped mpv loadfile command, see man mpv(1)."""
self.command('loadfile', filename.encode(fs_enc), mode, MPV._encode_options(options))
if _USE_LOADFILE_INDEX:
self.command('loadfile', filename.encode(fs_enc), mode, -1, MPV._encode_options(options))
else:
self.command('loadfile', filename.encode(fs_enc), mode, MPV._encode_options(options))

def loadlist(self, playlist, mode='replace'):
"""Mapped mpv loadlist command, see man mpv(1)."""
Expand Down

0 comments on commit 60a0e15

Please sign in to comment.