Skip to content

Commit 6f0fd95

Browse files
committed
Fix compilation
oops
1 parent 5931d7a commit 6f0fd95

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

av1an-core/src/context.rs

+25-7
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl Av1anContext {
308308

309309
let (tx, rx) = mpsc::channel();
310310
let handle = s.spawn(|_| {
311-
broker.encoding_loop(tx, self.args.set_thread_affinity);
311+
broker.encoding_loop(tx, self.args.set_thread_affinity, self.args.ignore_frame_mismatch);
312312
});
313313

314314
// Queue::encoding_loop only sends a message if there was an error (meaning a chunk crashed)
@@ -348,11 +348,25 @@ impl Av1anContext {
348348
}
349349

350350
if let Some(ref tq) = self.args.target_quality {
351+
let mut temp_res = tq.vmaf_res.to_string();
352+
if tq.vmaf_res == "inputres" {
353+
let inputres = self.args.input.resolution()?;
354+
temp_res.push_str(&format!(
355+
"{}x{}",
356+
&inputres.0.to_string(),
357+
&inputres.1.to_string()
358+
));
359+
temp_res.to_string();
360+
} else {
361+
temp_res = tq.vmaf_res.to_string();
362+
}
363+
351364
if let Err(e) = vmaf::plot(
352365
self.args.output_file.as_ref(),
353366
&self.args.input,
354367
tq.model.as_deref(),
355-
tq.vmaf_res.as_str(),
368+
temp_res.as_str(),
369+
tq.vmaf_scaler.as_str(),
356370
1,
357371
tq.vmaf_filter.as_deref(),
358372
tq.vmaf_threads,
@@ -400,6 +414,7 @@ impl Av1anContext {
400414
current_pass: u8,
401415
worker_id: usize,
402416
padding: usize,
417+
ignore_frame_mismatch: bool,
403418
) -> Result<(), (Box<EncoderCrash>, u64)> {
404419
update_mp_chunk(worker_id, chunk.index, padding);
405420

@@ -618,11 +633,13 @@ impl Av1anContext {
618633
let encoded_frames = num_frames(chunk.output().as_ref());
619634

620635
let err_str = match encoded_frames {
621-
Ok(encoded_frames) if encoded_frames != chunk.frames() => Some(format!(
622-
"FRAME MISMATCH: chunk {}: {encoded_frames}/{} (actual/expected frames)",
623-
chunk.index,
624-
chunk.frames()
625-
)),
636+
Ok(encoded_frames) if !ignore_frame_mismatch && encoded_frames != chunk.frames() => {
637+
Some(format!(
638+
"FRAME MISMATCH: chunk {}: {encoded_frames}/{} (actual/expected frames)",
639+
chunk.index,
640+
chunk.frames()
641+
))
642+
}
626643
Err(error) => Some(format!(
627644
"FAILED TO COUNT FRAMES: chunk {}: {error}",
628645
chunk.index
@@ -689,6 +706,7 @@ impl Av1anContext {
689706
self.frames,
690707
self.args.min_scene_len,
691708
self.args.verbosity,
709+
self.args.scaler.as_str(),
692710
self.args.sc_pix_format,
693711
self.args.sc_method,
694712
self.args.sc_downscale_height,

av1an-core/src/settings.rs

-11
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,6 @@ properly into a mkv file. Specify mkvmerge as the concatenation method by settin
132132
warn!("The output video's frame count may differ, and VMAF calculations may be incorrect");
133133
}
134134

135-
if self.vmaf_res == "inputres" {
136-
let inputres = self.input.resolution()?;
137-
self.vmaf_res.clear();
138-
self.vmaf_res.push_str(&format!(
139-
"{}x{}",
140-
&inputres.0.to_string(),
141-
&inputres.1.to_string()
142-
));
143-
self.vmaf_res.to_string();
144-
}
145-
146135
if let Some(vmaf_path) = &self
147136
.target_quality
148137
.as_ref()

0 commit comments

Comments
 (0)