mirror of
https://github.com/jellyfin/jellyfin-roku.git
synced 2024-11-23 06:09:41 +00:00
Merge pull request #1964 from cewert/maxvideodecoderesolution
This commit is contained in:
commit
d17a8d921e
@ -79,6 +79,16 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s
|
||||
end if
|
||||
|
||||
session.video.Update(meta)
|
||||
|
||||
if isValid(meta.json.MediaSources[0].RunTimeTicks)
|
||||
if meta.json.MediaSources[0].RunTimeTicks = 0
|
||||
video.length = 0
|
||||
else
|
||||
video.length = meta.json.MediaSources[0].RunTimeTicks / 10000000
|
||||
end if
|
||||
end if
|
||||
video.MaxVideoDecodeResolution = [meta.json.MediaSources[0].MediaStreams[0].Width, meta.json.MediaSources[0].MediaStreams[0].Height]
|
||||
|
||||
subtitle_idx = m.top.selectedSubtitleIndex
|
||||
videotype = LCase(meta.type)
|
||||
|
||||
@ -183,6 +193,11 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s
|
||||
end if
|
||||
|
||||
video.container = getContainerType(meta)
|
||||
if video.container = "mp4"
|
||||
video.content.StreamFormat = "mp4"
|
||||
else if video.container = "mkv"
|
||||
video.content.StreamFormat = "mkv"
|
||||
end if
|
||||
|
||||
if not isValid(m.playbackInfo.MediaSources[0])
|
||||
m.playbackInfo = meta.json
|
||||
|
@ -38,28 +38,31 @@ function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string, audioT
|
||||
end if
|
||||
|
||||
if audioTrackIndex > -1
|
||||
params.AudioStreamIndex = audioTrackIndex
|
||||
|
||||
' 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
|
||||
selectedAudioStream = m.global.session.video.json.MediaStreams[audioTrackIndex]
|
||||
|
||||
if LCase(selectedAudioStream.Codec) = "aac"
|
||||
if LCase(selectedAudioStream.Profile) = "main" or LCase(selectedAudioStream.Profile) = "he-aac"
|
||||
for each rule in deviceProfile.TranscodingProfiles
|
||||
if rule.Container = "ts" or rule.Container = "mp4"
|
||||
if rule.AudioCodec = "aac"
|
||||
rule.AudioCodec = "mp3"
|
||||
else if rule.AudioCodec.Left(4) = "aac,"
|
||||
rule.AudioCodec = mid(rule.AudioCodec, 5)
|
||||
if selectedAudioStream <> invalid
|
||||
params.AudioStreamIndex = audioTrackIndex
|
||||
|
||||
if rule.AudioCodec.Left(3) <> "mp3"
|
||||
rule.AudioCodec = "mp3," + rule.AudioCodec
|
||||
' 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 LCase(selectedAudioStream.Codec) = "aac"
|
||||
if LCase(selectedAudioStream.Profile) = "main" or LCase(selectedAudioStream.Profile) = "he-aac"
|
||||
for each rule in deviceProfile.TranscodingProfiles
|
||||
if rule.Container = "ts" or rule.Container = "mp4"
|
||||
if rule.AudioCodec = "aac"
|
||||
rule.AudioCodec = "mp3"
|
||||
else if rule.AudioCodec.Left(4) = "aac,"
|
||||
rule.AudioCodec = mid(rule.AudioCodec, 5)
|
||||
|
||||
if rule.AudioCodec.Left(3) <> "mp3"
|
||||
rule.AudioCodec = "mp3," + rule.AudioCodec
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end for
|
||||
end for
|
||||
end if
|
||||
end if
|
||||
|
||||
end if
|
||||
end if
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user