From 557a09186562e20cb9a6cc3dc696663416a0c612 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Wed, 17 Feb 2021 10:07:54 +0100 Subject: [PATCH] Merge pull request #5251 from crobibero/vpp-null-ref Fix vpp null reference (cherry picked from commit 467cd9227e63ed596f7d8b40b27efc4bf48eb02a) Signed-off-by: Joshua M. Boniface --- MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index 3b7ae4c32d..fa9222023a 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -131,6 +131,12 @@ namespace MediaBrowser.Controller.MediaEncoding private bool IsVppTonemappingSupported(EncodingJobInfo state, EncodingOptions options) { var videoStream = state.VideoStream; + if (videoStream == null) + { + // Remote stream doesn't have media info, disable vpp tonemapping. + return false; + } + var codec = videoStream.Codec; if (string.Equals(options.HardwareAccelerationType, "vaapi", StringComparison.OrdinalIgnoreCase)) {