Skip to content

Commit

Permalink
only force mp3 when it's not live tv
Browse files Browse the repository at this point in the history
  • Loading branch information
cewert committed Nov 13, 2024
1 parent 6d87f3a commit 372deca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/api/Items.bs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioT
}
deviceProfile = getDeviceProfile()

isLiveTV = false

' Note: Jellyfin v10.9+ now remuxs LiveTV and does not allow DirectPlay anymore.
' Because of this, we need to tell the server "EnableDirectPlay = false" so that we receive the
' transcoding URL (which is just a remux and not a transcode; unless it is)
Expand All @@ -35,6 +37,7 @@ function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioT
else
' No mediaSourceId? Must be LiveTV...
params.EnableDirectPlay = false
isLiveTV = true
end if

myGLobal = m.global
Expand All @@ -47,7 +50,7 @@ function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioT

' force the server to transcode AAC profiles we don't support to MP3 instead of the usual AAC
' TODO: Remove this after server adds support for transcoding AAC from one profile to another
if selectedAudioStream.Codec <> invalid and LCase(selectedAudioStream.Codec) = "aac"
if not isLiveTV and selectedAudioStream.Codec <> invalid and LCase(selectedAudioStream.Codec) = "aac"
if selectedAudioStream.Profile <> invalid and LCase(selectedAudioStream.Profile) = "main" or LCase(selectedAudioStream.Profile) = "he-aac"
for each rule in deviceProfile.TranscodingProfiles
if rule.Container = "ts" or rule.Container = "mp4"
Expand Down

0 comments on commit 372deca

Please sign in to comment.