This commit is contained in:
Honney OC committed 2026-10-11 16:59:09 +00:00
1 parent 8b06eb2e42
commit 687b3bf77a
2 files changed
+17 -16

No files matched your search

+10 -10
View File
@@ -133,16 +133,16 @@ class ApplySyncWorker(QtCore.QThread):
total_frames, _total_ms = self.probe_video_total(self.video_a)
# Single merged pipe: apply_sync forwards ffmpeg -progress key=value
# lines on stdout; human text has no "=" and is skipped for progress.
# stdout pipe carries only the -progress protocol (+ apply_sync's
# human log lines, forwarded below). stderr is inherited so ffmpeg's
# final summary stays visible in the launching terminal when run via ast.
proc = subprocess.Popen(
cmd, cwd=script_dir,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
stdout=subprocess.PIPE, stderr=None,
universal_newlines=True, bufsize=1
)
frames_done = 0
last_line = ""
assert proc.stdout is not None
for line in proc.stdout:
if self._abort:
@@ -152,7 +152,6 @@ class ApplySyncWorker(QtCore.QThread):
line = line.strip()
if not line:
continue
last_line = line
if line.startswith("frame="):
try:
frames_done = int(line.split("=", 1)[1].strip())
@@ -162,13 +161,14 @@ class ApplySyncWorker(QtCore.QThread):
elif line.startswith("progress=end"):
self.progress.emit(total_frames or frames_done,
total_frames or frames_done)
elif "=" not in line and ("error" in line.lower() or "failed" in line.lower()):
self.status.emit(line)
elif "=" not in line:
# Human-readable log (File A/B, Lag, Output, Synced output):
# mirror to the terminal instead of swallowing it.
print(f"[apply_sync] {line}", flush=True)
if "error" in line.lower() or "failed" in line.lower():
self.status.emit(line)
rc = proc.wait()
# Keep ffmpeg's final summary line visible in the launching terminal.
if last_line:
print(f"[apply_sync] {last_line}", flush=True)
self.finished.emit(rc == 0)