From 2de12dd61df3ecd85e1b9b315133d5ae193f459a Mon Sep 17 00:00:00 2001 From: Malte Rosenbjerg Date: Thu, 21 Oct 2021 19:44:22 +0200 Subject: [PATCH] Minor fixes Former-commit-id: 06da927c7e8552ae124a76e72bb72af0ddc428ce --- FFMpegCore/FFMpeg/FFMpeg.cs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/FFMpegCore/FFMpeg/FFMpeg.cs b/FFMpegCore/FFMpeg/FFMpeg.cs index ed3d390..13563ce 100644 --- a/FFMpegCore/FFMpeg/FFMpeg.cs +++ b/FFMpegCore/FFMpeg/FFMpeg.cs @@ -116,12 +116,9 @@ private static (FFMpegArguments, Action outputOptions) Bu { captureTime ??= TimeSpan.FromSeconds(source.Duration.TotalSeconds / 3); size = PrepareSnapshotSize(source, size); - if (streamIndex == null) - { - streamIndex = source.PrimaryVideoStream?.Index - ?? source.VideoStreams.First()?.Index - ?? 0; - } + streamIndex ??= source.PrimaryVideoStream?.Index + ?? source.VideoStreams.FirstOrDefault()?.Index + ?? 0; return (FFMpegArguments .FromFileInput(input, false, options => options