diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2025-10-11 17:20:52 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-11 17:20:52 -0400 |
| commit | c88d792963ef71fb9a7fccdc42c4d7a5a4adc136 (patch) | |
| tree | be7495d03083204793b879d67eacb11ced9618cf | |
| parent | 73dbc9e89f94831d8342d4b4cdccb0f7731ec424 (diff) | |
| parent | 6097045d71b4518cc118a98917125927c676e128 (diff) | |
Merge pull request #14960 from karm235/13697-fix-lufs-detection
Fix LUFS detection deadlock per issue #13697
| -rw-r--r-- | Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs index a28f280af..36708e258 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs @@ -261,14 +261,22 @@ public partial class AudioNormalizationTask : IScheduledTask using var reader = process.StandardError; float? lufs = null; + var foundLufs = false; await foreach (var line in reader.ReadAllLinesAsync(cancellationToken).ConfigureAwait(false)) { + if (foundLufs) + { + continue; + } + Match match = LUFSRegex().Match(line); - if (match.Success) + if (!match.Success) { - lufs = float.Parse(match.Groups[1].ValueSpan, CultureInfo.InvariantCulture.NumberFormat); - break; + continue; } + + lufs = float.Parse(match.Groups[1].ValueSpan, CultureInfo.InvariantCulture.NumberFormat); + foundLufs = true; } if (lufs is null) |
