mirror of
https://github.com/Radarr/Radarr.git
synced 2024-08-18 08:19:38 +02:00
Fixed: Null reference error getting video file info
This commit is contained in:
parent
3acc6a3f9d
commit
d33bed6a36
@ -75,10 +75,6 @@ private static IntPtr LoadNativeLib(string libraryName, Assembly assembly, DllIm
|
||||
{
|
||||
mappedName = "libsqlite3.so.0";
|
||||
}
|
||||
else if (libraryName == "mediainfo")
|
||||
{
|
||||
mappedName = "libmediainfo.so.0";
|
||||
}
|
||||
}
|
||||
|
||||
return NativeLibrary.Load(mappedName, assembly, dllImportSearchPath);
|
||||
|
@ -77,7 +77,7 @@ public MediaInfoModel GetMediaInfo(string filename)
|
||||
VideoProfile = analysis.PrimaryVideoStream?.Profile,
|
||||
VideoBitrate = analysis.PrimaryVideoStream?.BitRate ?? 0,
|
||||
VideoMultiViewCount = 1,
|
||||
VideoBitDepth = GetPixelFormat(analysis.PrimaryVideoStream?.PixelFormat).Components.Min(x => x.BitDepth),
|
||||
VideoBitDepth = GetPixelFormat(analysis.PrimaryVideoStream?.PixelFormat)?.Components.Min(x => x.BitDepth) ?? 8,
|
||||
VideoColourPrimaries = analysis.PrimaryVideoStream?.ColorPrimaries,
|
||||
VideoTransferCharacteristics = analysis.PrimaryVideoStream?.ColorTransfer,
|
||||
DoviConfigurationRecord = analysis.PrimaryVideoStream?.SideDataList?.Find(x => x.GetType().Name == nameof(DoviConfigurationRecordSideData)) as DoviConfigurationRecordSideData,
|
||||
@ -87,7 +87,7 @@ public MediaInfoModel GetMediaInfo(string filename)
|
||||
AudioCodecID = analysis.PrimaryAudioStream?.CodecTagString,
|
||||
AudioProfile = analysis.PrimaryAudioStream?.Profile,
|
||||
AudioBitrate = analysis.PrimaryAudioStream?.BitRate ?? 0,
|
||||
RunTime = GetBestRuntime(analysis.PrimaryAudioStream?.Duration, analysis.PrimaryVideoStream.Duration, analysis.Format.Duration),
|
||||
RunTime = GetBestRuntime(analysis.PrimaryAudioStream?.Duration, analysis.PrimaryVideoStream?.Duration, analysis.Format.Duration),
|
||||
AudioStreamCount = analysis.AudioStreams.Count,
|
||||
AudioChannels = analysis.PrimaryAudioStream?.Channels ?? 0,
|
||||
AudioChannelPositions = analysis.PrimaryAudioStream?.ChannelLayout,
|
||||
|
@ -53,7 +53,7 @@ public DetectSampleResult IsSample(Movie movie, string path)
|
||||
|
||||
if (!runTime.HasValue)
|
||||
{
|
||||
_logger.Error("Failed to get runtime from the file, make sure mediainfo is available");
|
||||
_logger.Error("Failed to get runtime from the file, make sure ffprobe is available");
|
||||
return DetectSampleResult.Indeterminate;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user