Skip to content

Commit a0e29dd

Browse files
authored
Merge pull request #12878 from nanaya/audio-time-convert
Fix unit conversion
2 parents 61ac58d + 50acf19 commit a0e29dd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/Models/BeatmapsetArchive.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ private static function convertAudioForPreview(string $audioFile, ?int $previewT
7979

8080
$duration = 10000;
8181
if ($previewTime === null || $previewTime < 0) {
82+
// the output is in seconds
8283
$srcDuration = (float) exec(implode(' ', [
8384
'timeout 10s',
8485
'ffprobe',
@@ -87,7 +88,7 @@ private static function convertAudioForPreview(string $audioFile, ?int $previewT
8788
'-show_entries format=duration',
8889
'-of csv=p=0',
8990
]));
90-
$previewTime = 0.4 * $srcDuration * 100;
91+
$previewTime = 0.4 * $srcDuration * 1000;
9192
}
9293

9394
$fadeInExtension = min($previewTime, 100);

0 commit comments

Comments
 (0)