Skip to content

Commit 53be365

Browse files
authored
Fix mpv loadfile syntax change 2 (#3711)
* Revert "Fix mpv loadfile syntax change (#3105)" This reverts commit 111f3bd. * Fix mpv loadfile syntax change 2
1 parent 4c34a2d commit 53be365

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

qt/aqt/mpv.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class MPVBase:
8888
"--keep-open=no",
8989
"--autoload-files=no",
9090
"--gapless-audio=no",
91-
"--reset-on-next-file=pause",
9291
]
9392

9493
if is_win:

qt/aqt/sound.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,12 @@ def on_init(self) -> None:
427427
if self._on_done:
428428
self._on_done()
429429

430+
m = re.search(r"(\d+)\.(\d+)\.(\d+)", self.get_property("mpv-version"))
431+
if m:
432+
self.mpv_version = (int(m[1]), int(m[2]), int(m[3]))
433+
else:
434+
self.mpv_version = None
435+
430436
try:
431437
self.command("keybind", "q", "stop")
432438
self.command("keybind", "Q", "stop")
@@ -442,7 +448,10 @@ def play(self, tag: AVTag, on_done: OnDoneCallback) -> None:
442448
filename = hooks.media_file_filter(tag.filename)
443449
path = os.path.join(self.media_folder, filename)
444450

445-
self.command("loadfile", path, "replace")
451+
if self.mpv_version is None or self.mpv_version >= (0, 38, 0):
452+
self.command("loadfile", path, "replace", -1, "pause=no")
453+
else:
454+
self.command("loadfile", path, "replace", "pause=no")
446455
gui_hooks.av_player_did_begin_playing(self, tag)
447456

448457
def stop(self) -> None:

0 commit comments

Comments
 (0)