mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-22 00:35:26 +03:00
Add more robust error handling for AudioNormalizationTask (#14728)
This commit is contained in:
@@ -121,9 +121,16 @@ public partial class AudioNormalizationTask : IScheduledTask
|
|||||||
toSaveDbItems.Add(a);
|
toSaveDbItems.Add(a);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
File.Delete(tempFile);
|
File.Delete(tempFile);
|
||||||
}
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Failed to delete concat file: {FileName}.", tempFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,11 +239,10 @@ public partial class AudioNormalizationTask : IScheduledTask
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
|
_logger.LogDebug("Starting ffmpeg with arguments: {Arguments}", args);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
_logger.LogDebug("Starting ffmpeg with arguments: {Arguments}", args);
|
|
||||||
process.Start();
|
process.Start();
|
||||||
process.PriorityClass = ProcessPriorityClass.BelowNormal;
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
@@ -244,6 +250,15 @@ public partial class AudioNormalizationTask : IScheduledTask
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
process.PriorityClass = ProcessPriorityClass.BelowNormal;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogWarning(ex, "Error setting ffmpeg process priority");
|
||||||
|
}
|
||||||
|
|
||||||
using var reader = process.StandardError;
|
using var reader = process.StandardError;
|
||||||
float? lufs = null;
|
float? lufs = null;
|
||||||
await foreach (var line in reader.ReadAllLinesAsync(cancellationToken).ConfigureAwait(false))
|
await foreach (var line in reader.ReadAllLinesAsync(cancellationToken).ConfigureAwait(false))
|
||||||
|
|||||||
Reference in New Issue
Block a user