Skip to content

Commit fb11bc9

Browse files
authored
Allow scoring tools to finish naturally instead of breaking early (#337)
Previously, the code would break out of the loop as soon as the score was calculated, but before the underlying process had fully completed. This could cause process cleanup issues and race conditions. Now the code continues processing until the stream naturally ends, ensuring proper cleanup.
1 parent a815671 commit fb11bc9

3 files changed

Lines changed: 0 additions & 4 deletions

File tree

src/command/sample_encode.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,6 @@ pub fn run(
318318
match vmaf {
319319
VmafOut::Done(score) => {
320320
vmaf_score = Some(score);
321-
break;
322321
}
323322
VmafOut::Progress(FfmpegOut::Progress { time, fps, .. }) => {
324323
yield Update::Status(Status {
@@ -375,7 +374,6 @@ pub fn run(
375374
match next {
376375
XpsnrOut::Done(s) => {
377376
score = Some(s);
378-
break;
379377
}
380378
XpsnrOut::Progress(FfmpegOut::Progress { time, fps, .. }) => {
381379
yield Update::Status(Status {

src/command/vmaf.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ pub async fn vmaf(
8383
match vmaf {
8484
VmafOut::Done(score) => {
8585
vmaf_score = Some(score);
86-
break;
8786
}
8887
VmafOut::Progress(FfmpegOut::Progress {
8988
frame, fps, time, ..

src/command/xpsnr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ pub async fn xpsnr(
7979
match next {
8080
XpsnrOut::Done(s) => {
8181
score = Some(s);
82-
break;
8382
}
8483
XpsnrOut::Progress(FfmpegOut::Progress {
8584
frame, fps, time, ..

0 commit comments

Comments
 (0)