attempting to fix issue with parsing channels

This commit is contained in:
John Andrews
2024-01-06 08:32:08 +13:00
parent 9724093daa
commit 06586f0a7c
+11 -6
View File
@@ -310,11 +310,12 @@ public class VideoInfoHelper
audio.Codec = audio.Codec[..^1].Trim();
audio.Language = GetLanguage(line);
if (info.IndexOf("0 channels") >= 0)
{
audio.Channels = 0;
}
else
// if (info.IndexOf("0 channels", StringComparison.Ordinal) >= 0)
// {
// logger?.WLog("Stream contained '0 Channels'");
// audio.Channels = 0;
// }
// else
{
try
{
@@ -342,9 +343,13 @@ public class VideoInfoHelper
{
logger?.WLog("Unable to detect channels from: " + line);
}
logger?.ILog("Audio channels: " + audio.Channels + ", from " + parts[2]);
}
catch (Exception) { }
catch (Exception ex)
{
logger?.WLog("Failed to parse audio channels: " + ex.Message + "\n" + "From line: " + line);
}
}
var match = rgxAudioSampleRate.Match(info);