fix: skip mpv gracefully when video file unavailable
This commit is contained in:
1 parent
acca4f4b66
commit
6d788f406c
1 file changed
+10
-3
+10
-3
@@ -484,6 +484,10 @@ class VerifyWindow(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
def _start_mpv(self):
|
def _start_mpv(self):
|
||||||
"""Launch mpv in its own window, controlled via IPC socket."""
|
"""Launch mpv in its own window, controlled via IPC socket."""
|
||||||
|
if not self.video_path or not os.path.exists(self.video_path):
|
||||||
|
print(f"mpv skipped: no video file available", file=sys.stderr)
|
||||||
|
self.info_label.setText(self.info_label.text() + " | mpv: unavailable")
|
||||||
|
return
|
||||||
print(f"Launching mpv: {self.video_path}")
|
print(f"Launching mpv: {self.video_path}")
|
||||||
try:
|
try:
|
||||||
self.mpv = MpvController(self.video_path)
|
self.mpv = MpvController(self.video_path)
|
||||||
@@ -776,8 +780,6 @@ def main():
|
|||||||
stem_b = os.path.splitext(os.path.basename(video_b))[0]
|
stem_b = os.path.splitext(os.path.basename(video_b))[0]
|
||||||
wav_b = os.path.join(out_dir_extract, f"{stem_b}_audio.wav")
|
wav_b = os.path.join(out_dir_extract, f"{stem_b}_audio.wav")
|
||||||
|
|
||||||
if not video_a or not os.path.exists(video_a):
|
|
||||||
print(f"ERROR: video A not found: {video_a}", file=sys.stderr); sys.exit(1)
|
|
||||||
if not wav_a or not os.path.exists(wav_a):
|
if not wav_a or not os.path.exists(wav_a):
|
||||||
print(f"ERROR: wav A not found: {wav_a}", file=sys.stderr); sys.exit(1)
|
print(f"ERROR: wav A not found: {wav_a}", file=sys.stderr); sys.exit(1)
|
||||||
if not wav_b or not os.path.exists(wav_b):
|
if not wav_b or not os.path.exists(wav_b):
|
||||||
@@ -790,8 +792,13 @@ def main():
|
|||||||
if os.path.exists(extracted_video):
|
if os.path.exists(extracted_video):
|
||||||
video_path = extracted_video
|
video_path = extracted_video
|
||||||
print(f"Using extracted video: {video_path}")
|
print(f"Using extracted video: {video_path}")
|
||||||
|
elif video_a and os.path.exists(video_a):
|
||||||
|
pass # use original
|
||||||
else:
|
else:
|
||||||
print(f"WARNING: extracted video not found ({extracted_video}), using original", file=sys.stderr)
|
print(f"WARNING: no video found (extracted or original) for A, mpv will be unavailable", file=sys.stderr)
|
||||||
|
else:
|
||||||
|
if not video_a or not os.path.exists(video_a):
|
||||||
|
print(f"ERROR: video A not found: {video_a}", file=sys.stderr); sys.exit(1)
|
||||||
temp_dir = None
|
temp_dir = None
|
||||||
cache_key_a = None
|
cache_key_a = None
|
||||||
cache_key_b = None
|
cache_key_b = None
|
||||||
|
|||||||
Reference in new issue
Block a user