Skip to content

Commit

Permalink
remove unnecessary code
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Sep 25, 2024
1 parent fa7b36f commit 93fe368
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/main/ffmpeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,10 @@ function handleProgress(
if (durationIn == null) return;
const duration = Math.max(0, durationIn);
if (duration === 0) return;
const progress = duration ? Math.min(progressTime / duration, 1) : 0; // sometimes progressTime will be greater than cutDuration
const progress = Math.min(progressTime / duration, 1); // sometimes progressTime will be greater than cutDuration
onProgress(progress);
} catch (err) {
// @ts-expect-error todo
logger.error('Failed to parse ffmpeg progress line:', err.message);
logger.error('Failed to parse ffmpeg progress line:', err instanceof Error ? err.message : err);
}
});
}
Expand Down

0 comments on commit 93fe368

Please sign in to comment.