mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-25 19:46:47 +08:00
fix: loudnorm out of range (#1371)
This commit is contained in:
committed by
GitHub
parent
2817c8f5b1
commit
05636b33c0
@@ -747,7 +747,7 @@ class PlPlayerController {
|
||||
}
|
||||
}
|
||||
|
||||
static final loudnormRegExp = RegExp('loudnorm=[^,]+');
|
||||
static final loudnormRegExp = RegExp('loudnorm=([^,]+)');
|
||||
|
||||
// 配置播放器
|
||||
Future<Player> _createVideoController(
|
||||
@@ -845,7 +845,15 @@ class PlPlayerController {
|
||||
if (volume != null && volume.isNotEmpty) {
|
||||
audioNormalization = audioNormalization.replaceFirstMapped(
|
||||
loudnormRegExp,
|
||||
(i) => '${i[0]}:$volume',
|
||||
(i) =>
|
||||
'loudnorm=${volume.format(
|
||||
Map.fromEntries(
|
||||
i.group(1)!.split(':').map((item) {
|
||||
final parts = item.split('=');
|
||||
return MapEntry(parts[0].toLowerCase(), num.parse(parts[1]));
|
||||
}),
|
||||
),
|
||||
)}',
|
||||
);
|
||||
} else {
|
||||
audioNormalization = audioNormalization.replaceFirst(
|
||||
|
||||
Reference in New Issue
Block a user