combine audio codec settings

This commit is contained in:
Chris Forte 2024-02-15 09:57:37 -05:00
parent 425512b00f
commit ed5d73de4b
3 changed files with 4 additions and 63 deletions

View File

@ -1117,16 +1117,6 @@
<translation>Choose your preferred audio codecs when transcoding.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
<message>
<source>Multichannel Audio - DTS</source>
<translation>Multichannel Audio - DTS</translation>
<extracomment>Settings Menu - Title of option</extracomment>
</message>
<message>
<source>Force all audio transcodes to use DTS instead of the default EAC3. The device must support DTS for this setting to have an effect.</source>
<translation>Force all audio transcodes to use DTS instead of the default EAC3. The device must support DTS for this setting to have an effect.</translation>
<extracomment>Settings Menu - Description for option</extracomment>
</message>
<message>
<source>Preferred Audio Codec</source>
<translation>Preferred Audio Codec</translation>

View File

@ -20,13 +20,6 @@
"title": "Audio Codec Support",
"description": "Choose your preferred audio codecs when transcoding.",
"children": [
{
"title": "Multichannel Audio - DTS",
"description": "Force all audio transcodes to use DTS instead of the default EAC3. The device must support DTS for this setting to have an effect.",
"settingName": "playback.forceDTS",
"type": "bool",
"default": "false"
},
{
"title": "Preferred Audio Codec",
"description": "Use the selected audio codec for transcodes. If the device or stream does not support it, a fallback codec will be used.",

View File

@ -195,21 +195,13 @@ function getTranscodingProfiles() as object
' does the users setup support surround sound?
maxAudioChannels = "2" ' jellyfin expects this as a string
' in order of preference from left to right
audioCodecs = ["mp3", "vorbis", "opus", "flac", "alac", "ac4", "pcm", "wma", "wmapro"]
surroundSoundCodecs = ["eac3", "ac3", "dts"]
if globalUserSettings["playback.forceDTS"] = true
surroundSoundCodecs = ["dts", "eac3", "ac3"]
end if
audioCodecs = ["eac3", "ac3", "dts", "mp3", "vorbis", "opus", "flac", "alac", "ac4", "pcm", "wma", "wmapro"]
surroundSoundCodec = invalid
if di.GetAudioOutputChannel() = "5.1 surround"
maxAudioChannels = "6"
for each codec in surroundSoundCodecs
if di.CanDecodeAudio({ Codec: codec, ChCnt: 6 }).Result
surroundSoundCodec = codec
if di.CanDecodeAudio({ Codec: codec, ChCnt: 8 }).Result
maxAudioChannels = "8"
end if
for each codec in audioCodecs
if di.CanDecodeAudio({ Codec: codec, ChCnt: 8 }).Result
maxAudioChannels = "8"
exit for
end if
end for
@ -403,40 +395,6 @@ function getTranscodingProfiles() as object
mp4Array.Conditions = [getMaxHeightArray(), getMaxWidthArray()]
end if
' surround sound
if surroundSoundCodec <> invalid
' add preferred surround sound codec to TranscodingProfile
transcodingProfiles.push({
"Container": surroundSoundCodec,
"Type": "Audio",
"AudioCodec": surroundSoundCodec,
"Context": "Streaming",
"Protocol": "http",
"MaxAudioChannels": maxAudioChannels
})
transcodingProfiles.push({
"Container": surroundSoundCodec,
"Type": "Audio",
"AudioCodec": surroundSoundCodec,
"Context": "Static",
"Protocol": "http",
"MaxAudioChannels": maxAudioChannels
})
' put codec in front of AudioCodec string
if tsArray.AudioCodec = ""
tsArray.AudioCodec = surroundSoundCodec
else
tsArray.AudioCodec = surroundSoundCodec + "," + tsArray.AudioCodec
end if
if mp4Array.AudioCodec = ""
mp4Array.AudioCodec = surroundSoundCodec
else
mp4Array.AudioCodec = surroundSoundCodec + "," + mp4Array.AudioCodec
end if
end if
' add user-selected preferred codec to the front of the list
if globalUserSettings["playback.preferredAudioCodec"] <> "auto"
tsArray.AudioCodec = globalUserSettings["playback.preferredAudioCodec"] + "," + tsArray.AudioCodec