ignore progress send errors without faking a drop

This commit is contained in:
2026-09-21 01:07:21 +03:00
parent e0ceb7591c
commit 29cd5a8050
+7 -3
View File
@@ -393,7 +393,9 @@ fn two_pass_video(
// Send 50% to signal pass 1 done, pass 2 starting.
if let Some(ref t) = tx {
drop(t.send(EncodeProgress { pass: 1, total_passes: 2, percent: 100.0 }));
// The receiver is gone only if the UI navigated away; the encode is
// unaffected, so the send error is deliberately discarded.
let _ = t.send(EncodeProgress { pass: 1, total_passes: 2, percent: 100.0 });
}
let mut pass2 = Command::new(ffmpeg);
@@ -1192,11 +1194,13 @@ fn run_impl(
} else if key == "progress" {
let percent = (last_out_time_us / encode_dur_us * 100.0).clamp(0.0, 100.0);
if let Some(ref sender) = tx {
drop(sender.send(EncodeProgress {
// A dropped receiver means the frontend is gone;
// the encode keeps running either way.
let _ = sender.send(EncodeProgress {
pass,
total_passes,
percent,
}));
});
}
}
}