mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-10-31 18:47:18 -04:00
Fix LUFS detection deadlock on albums with verbose output
This commit is contained in:
parent
eb0d05cf1e
commit
51e20a14c2
@ -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))
|
||||
{
|
||||
Match match = LUFSRegex().Match(line);
|
||||
if (match.Success)
|
||||
if (foundLufs)
|
||||
{
|
||||
lufs = float.Parse(match.Groups[1].ValueSpan, CultureInfo.InvariantCulture.NumberFormat);
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
|
||||
Match match = LUFSRegex().Match(line);
|
||||
if (!match.Success)
|
||||
{
|
||||
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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user