aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs')
-rw-r--r--Emby.Server.Implementations/ScheduledTasks/Tasks/AudioNormalizationTask.cs15
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)