aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpeterspenler <peterspenler@gmail.com>2021-05-13 09:49:20 -0400
committerpeterspenler <peterspenler@gmail.com>2021-05-13 09:55:31 -0400
commit3c981cf41f2a8e498e674dc707f15b4ebb2679ae (patch)
tree4902e2b66e046c23f9fdb9504bee8ff47232a292
parent88a7875a2739bef91f1d7216c5ebd89b4c267911 (diff)
Reorder requested audio channels checks
-rw-r--r--CONTRIBUTORS.md1
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs20
2 files changed, 11 insertions, 10 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 7a763a46c..10ea6e883 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -146,6 +146,7 @@
- [nielsvanvelzen](https://github.com/nielsvanvelzen)
- [skyfrk](https://github.com/skyfrk)
- [ianjazz246](https://github.com/ianjazz246)
+ - [peterspenler](https://github.com/peterspenler)
# Emby Contributors
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
index 1e13382b7..0bb46df3f 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
@@ -274,6 +274,16 @@ namespace MediaBrowser.Controller.MediaEncoding
public int? GetRequestedAudioChannels(string codec)
{
+ if (!string.IsNullOrEmpty(codec))
+ {
+ var value = BaseRequest.GetOption(codec, "audiochannels");
+ if (!string.IsNullOrEmpty(value)
+ && int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out var result))
+ {
+ return result;
+ }
+ }
+
if (BaseRequest.MaxAudioChannels.HasValue)
{
return BaseRequest.MaxAudioChannels;
@@ -289,16 +299,6 @@ namespace MediaBrowser.Controller.MediaEncoding
return BaseRequest.TranscodingMaxAudioChannels;
}
- if (!string.IsNullOrEmpty(codec))
- {
- var value = BaseRequest.GetOption(codec, "audiochannels");
- if (!string.IsNullOrEmpty(value)
- && int.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out var result))
- {
- return result;
- }
- }
-
return null;
}