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

fix: av1 codecs string #11280

Merged
merged 5 commits into from
Apr 2, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions Jellyfin.Api/Helpers/HlsCodecStringHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,15 @@ public static string GetAv1String(string? profile, int level, bool tierFlag, int
result.Append(".0");
}

if (level <= 0
|| level > 31)
if (level is <= 0 or > 31)
{
// Default to the maximum defined level 6.3
level = 19;
}

// Needed to pad it two double digits; otherwise, browsers will reject the stream.
var levelString = level < 10 ? $"0{level}" : $"{level}";
gnattu marked this conversation as resolved.
Show resolved Hide resolved

if (bitDepth != 8
&& bitDepth != 10
&& bitDepth != 12)
Expand All @@ -230,7 +232,7 @@ public static string GetAv1String(string? profile, int level, bool tierFlag, int
}

result.Append('.')
.Append(level)
.Append(levelString)
gnattu marked this conversation as resolved.
Show resolved Hide resolved
.Append(tierFlag ? 'H' : 'M');

string bitDepthD2 = bitDepth.ToString("D2", CultureInfo.InvariantCulture);
Expand Down