From 476c8f33c07c22323792b445aa75d527fe3f2287 Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Sun, 29 Jan 2023 23:01:26 +0100 Subject: [PATCH] Cleanup --- FFMpegCore.Test/Utilities/BitmapSources.cs | 4 +++- FFMpegCore/FFMpeg/Arguments/AudibleEncryptionKeyArgument.cs | 6 +++--- FFMpegCore/FFProbe/FFProbeAnalysis.cs | 4 ++-- FFMpegCore/FFProbe/MediaAnalysis.cs | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/FFMpegCore.Test/Utilities/BitmapSources.cs b/FFMpegCore.Test/Utilities/BitmapSources.cs index 50dd691..044bfa8 100644 --- a/FFMpegCore.Test/Utilities/BitmapSources.cs +++ b/FFMpegCore.Test/Utilities/BitmapSources.cs @@ -3,11 +3,13 @@ using System.Drawing; using System.Drawing.Imaging; using System.Numerics; +using System.Runtime.Versioning; using FFMpegCore.Extensions.System.Drawing.Common; using FFMpegCore.Pipes; -namespace FFMpegCore.Test +namespace FFMpegCore.Test.Utilities { + [SupportedOSPlatform("windows")] static class BitmapSource { public static IEnumerable CreateBitmaps(int count, PixelFormat fmt, int w, int h) diff --git a/FFMpegCore/FFMpeg/Arguments/AudibleEncryptionKeyArgument.cs b/FFMpegCore/FFMpeg/Arguments/AudibleEncryptionKeyArgument.cs index 0f514dc..8b142e4 100644 --- a/FFMpegCore/FFMpeg/Arguments/AudibleEncryptionKeyArgument.cs +++ b/FFMpegCore/FFMpeg/Arguments/AudibleEncryptionKeyArgument.cs @@ -4,10 +4,10 @@ public class AudibleEncryptionKeyArgument : IArgument { private readonly bool _aaxcMode; - private readonly string _key; - private readonly string _iv; + private readonly string? _key; + private readonly string? _iv; - private readonly string _activationBytes; + private readonly string? _activationBytes; public AudibleEncryptionKeyArgument(string activationBytes) diff --git a/FFMpegCore/FFProbe/FFProbeAnalysis.cs b/FFMpegCore/FFProbe/FFProbeAnalysis.cs index cbbb9fd..b81d535 100644 --- a/FFMpegCore/FFProbe/FFProbeAnalysis.cs +++ b/FFMpegCore/FFProbe/FFProbeAnalysis.cs @@ -12,7 +12,7 @@ public class FFProbeAnalysis public Format Format { get; set; } = null!; [JsonIgnore] - public IReadOnlyList ErrorData { get; set; } + public IReadOnlyList ErrorData { get; set; } = new List(); } public class FFProbeStream : ITagsContainer, IDispositionContainer @@ -108,7 +108,7 @@ public class Format : ITagsContainer public string Size { get; set; } = null!; [JsonPropertyName("bit_rate")] - public string BitRate { get; set; } = null!; + public string? BitRate { get; set; } = null!; [JsonPropertyName("probe_score")] public int ProbeScore { get; set; } diff --git a/FFMpegCore/FFProbe/MediaAnalysis.cs b/FFMpegCore/FFProbe/MediaAnalysis.cs index e1fbd1d..fd2b135 100644 --- a/FFMpegCore/FFProbe/MediaAnalysis.cs +++ b/FFMpegCore/FFProbe/MediaAnalysis.cs @@ -13,7 +13,7 @@ internal MediaAnalysis(FFProbeAnalysis analysis) VideoStreams = analysis.Streams.Where(stream => stream.CodecType == "video").Select(ParseVideoStream).ToList(); AudioStreams = analysis.Streams.Where(stream => stream.CodecType == "audio").Select(ParseAudioStream).ToList(); SubtitleStreams = analysis.Streams.Where(stream => stream.CodecType == "subtitle").Select(ParseSubtitleStream).ToList(); - ErrorData = analysis.ErrorData ?? new List().AsReadOnly(); + ErrorData = analysis.ErrorData; } private MediaFormat ParseFormat(Format analysisFormat)