From 4a2245fe1e97c7d450557fd1269be8584a58c478 Mon Sep 17 00:00:00 2001 From: James Harvey <44349936+jmshrv@users.noreply.github.com> Date: Sat, 4 Feb 2023 18:52:35 +0000 Subject: [PATCH] Move mp4 container names to class and use StringComparer.OrdinalIgnoreCase --- .../MediaEncoding/EncodingHelper.cs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs index d6ab27b037..9b5edabc06 100644 --- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs +++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs @@ -61,6 +61,16 @@ namespace MediaBrowser.Controller.MediaEncoding "Main10" }; + private static readonly HashSet _mp4ContainerNames = new(StringComparer.OrdinalIgnoreCase) + { + "mp4", + "m4a", + "m4p", + "m4b", + "m4r", + "m4v", + }; + public EncodingHelper( IApplicationPaths appPaths, IMediaEncoder mediaEncoder, @@ -5788,17 +5798,7 @@ namespace MediaBrowser.Controller.MediaEncoding // Copy the movflags from GetProgressiveVideoFullCommandLine // See #9248 and the associated PR for why this is needed - var mp4ContainerNames = new HashSet - { - "mp4", - "m4a", - "m4p", - "m4b", - "m4r", - "m4v", - }; - - if (mp4ContainerNames.Contains(state.OutputContainer.ToLower())) + if (_mp4ContainerNames.Contains(state.OutputContainer)) { audioTranscodeParams.Add("-movflags empty_moov+delay_moov"); }