Skip to content

Commit

Permalink
Update API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jellyfin-bot committed Mar 17, 2024
1 parent 5f18ac9 commit a4f3461
Showing 1 changed file with 8 additions and 44 deletions.
52 changes: 8 additions & 44 deletions docs/api/source_utils_deviceCapabilities.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,21 +197,13 @@
' 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
Expand Down Expand Up @@ -405,38 +397,10 @@
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
' add user-selected preferred codec to the front of the list
if globalUserSettings["playback.preferredAudioCodec"] <> "auto"
tsArray.AudioCodec = globalUserSettings["playback.preferredAudioCodec"] + "," + tsArray.AudioCodec
mp4Array.AudioCodec = globalUserSettings["playback.preferredAudioCodec"] + "," + mp4Array.AudioCodec
end if

transcodingProfiles.push(tsArray)
Expand Down

0 comments on commit a4f3461

Please sign in to comment.