Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't enforce bitrate limits when server is local #1937

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 43 additions & 42 deletions source/utils/deviceCapabilities.bs
Original file line number Diff line number Diff line change
Expand Up @@ -892,53 +892,54 @@ end function

function GetBitRateLimit(codec as string) as object
globalUserSettings = m.global.session.user.settings
if globalUserSettings["playback.bitrate.maxlimited"]
userSetLimit = globalUserSettings["playback.bitrate.limit"].ToInt()
if isValid(userSetLimit) and type(userSetLimit) = "Integer" and userSetLimit > 0
userSetLimit *= 1000000
if m.global.session.server.localURL = m.global.session.server.url then return {} ' don't enforce bitrate limits when server is local
if not globalUserSettings["playback.bitrate.maxlimited"] then return {}

userSetLimit = globalUserSettings["playback.bitrate.limit"].ToInt()
if isValid(userSetLimit) and type(userSetLimit) = "Integer" and userSetLimit > 0
userSetLimit *= 1000000
return {
"Condition": "LessThanEqual",
"Property": "VideoBitrate",
"Value": userSetLimit.ToStr(),
"IsRequired": true
}
else
codec = Lcase(codec)
' Some repeated values (e.g. same "40mbps" for several codecs)
' but this makes it easy to update in the future if the bitrates start to deviate.
if codec = "h264"
' Roku only supports h264 up to 10Mpbs
return {
"Condition": "LessThanEqual",
"Property": "VideoBitrate",
"Value": userSetLimit.ToStr(),
"Value": "10000000",
"IsRequired": true
}
else if codec = "av1"
' Roku only supports AV1 up to 40Mpbs
return {
"Condition": "LessThanEqual",
"Property": "VideoBitrate",
"Value": "40000000",
"IsRequired": true
}
else if codec = "h265"
' Roku only supports h265 up to 40Mpbs
return {
"Condition": "LessThanEqual",
"Property": "VideoBitrate",
"Value": "40000000",
"IsRequired": true
}
else if codec = "vp9"
' Roku only supports VP9 up to 40Mpbs
return {
"Condition": "LessThanEqual",
"Property": "VideoBitrate",
"Value": "40000000",
"IsRequired": true
}
else
codec = Lcase(codec)
' Some repeated values (e.g. same "40mbps" for several codecs)
' but this makes it easy to update in the future if the bitrates start to deviate.
if codec = "h264"
' Roku only supports h264 up to 10Mpbs
return {
"Condition": "LessThanEqual",
"Property": "VideoBitrate",
"Value": "10000000",
"IsRequired": true
}
else if codec = "av1"
' Roku only supports AV1 up to 40Mpbs
return {
"Condition": "LessThanEqual",
"Property": "VideoBitrate",
"Value": "40000000",
"IsRequired": true
}
else if codec = "h265"
' Roku only supports h265 up to 40Mpbs
return {
"Condition": "LessThanEqual",
"Property": "VideoBitrate",
"Value": "40000000",
"IsRequired": true
}
else if codec = "vp9"
' Roku only supports VP9 up to 40Mpbs
return {
"Condition": "LessThanEqual",
"Property": "VideoBitrate",
"Value": "40000000",
"IsRequired": true
}
end if
end if
end if
return {}
Expand Down
Loading