diff options
| author | karm235 <phoenixai235@gmail.com> | 2025-10-07 12:11:02 -0500 |
|---|---|---|
| committer | karm235 <phoenixai235@gmail.com> | 2025-10-07 12:11:02 -0500 |
| commit | 51e20a14c29b67bf9e8c0bbf9e92f1fe406062c3 (patch) | |
| tree | 73bb8bc2535fbe97a690ba64a5e155a27726bda3 /Emby.Server.Implementations | |
| parent | eb0d05cf1ec1fb614639abbb6b7711fce9b7cbe5 (diff) | |
Fix LUFS detection deadlock on albums with verbose output
Diffstat (limited to 'Emby.Server.Implementations')
| -rw-r--r-- | Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs b/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs index a28f280af..78b8759c5 100644 --- a/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs +++ b/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs @@ -261,14 +261,23 @@ 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; + // Don't break - keep draining stderr to prevent buffer deadlock } if (lufs is null) |
