fix(segment-concat): out-of-bounds exception during media concat
All checks were successful
CI / Maven unit tests (push) Successful in 1m4s
CI / Build and push images (push) Has been skipped
CI / Deploy to server (push) Has been skipped

Caused by the duration exceeding 1, which caused CommandRunner to throw.
This commit is contained in:
2026-09-16 20:59:57 +01:00
parent 7dacb7a53a
commit bd3d99e801

View File

@@ -76,8 +76,9 @@ public class CommandRunner {
public void setProgress(String line, ProgressTracker progress, float length) {
Matcher matcher = timePattern.matcher(line);
if (matcher.find()) {
float timeInMs = Float.parseFloat(matcher.group(1)) / 1000000f;
progress.setProgress(timeInMs / length);
float timeInSeconds = Float.parseFloat(matcher.group(1)) / 1_000_000f;
float fraction = Math.clamp(timeInSeconds / length, 0f, 1f);
progress.setProgress(fraction);
}
}
}