discard send results explicitly and label the codec flags
This commit is contained in:
+10
-3
@@ -344,6 +344,13 @@ fn webm_video_codec(c: WebmCodec) -> &'static str {
|
||||
/// codecs (H265, AV1) are reported because those are the ones users pick to
|
||||
/// save size and only learn at minute 5 that their build lacks them.
|
||||
#[derive(Debug, Clone, serde::Serialize)]
|
||||
// Four independent per-codec flags, each meaningful on its own; they are what
|
||||
// the settings screen disables individually, so a bitflag would obscure more
|
||||
// than it saves.
|
||||
#[allow(
|
||||
clippy::struct_excessive_bools,
|
||||
reason = "one flag per codec, each surfaced separately in the UI"
|
||||
)]
|
||||
pub(crate) struct CodecAvailability {
|
||||
pub h264: bool,
|
||||
pub h265: bool,
|
||||
@@ -454,7 +461,7 @@ fn two_pass_video(
|
||||
if let Some(ref t) = tx {
|
||||
// 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 });
|
||||
drop(t.send(EncodeProgress { pass: 1, total_passes: 2, percent: 100.0 }));
|
||||
}
|
||||
|
||||
let mut pass2 = Command::new(ffmpeg);
|
||||
@@ -1265,11 +1272,11 @@ fn run_impl(
|
||||
if let Some(ref sender) = tx {
|
||||
// A dropped receiver means the frontend is gone;
|
||||
// the encode keeps running either way.
|
||||
let _ = sender.send(EncodeProgress {
|
||||
drop(sender.send(EncodeProgress {
|
||||
pass,
|
||||
total_passes,
|
||||
percent,
|
||||
});
|
||||
}));
|
||||
}
|
||||
}
|
||||
// frame=, fps=, bitrate= and friends are not needed.
|
||||
|
||||
Reference in New Issue
Block a user