Default to no bitrate limit if no maxBitrate is set (#8850)

Fixes https://github.com/jellyfin/jellyfin/issues/3277
This commit is contained in:
Shadowghost 2022-12-14 22:04:05 +01:00 committed by GitHub
parent 3f82c90c48
commit 81a7261980
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1450,15 +1450,16 @@ namespace MediaBrowser.Model.Dlna
private bool IsItemBitrateEligibleForDirectPlayback(MediaSourceInfo item, long maxBitrate, PlayMethod playMethod) private bool IsItemBitrateEligibleForDirectPlayback(MediaSourceInfo item, long maxBitrate, PlayMethod playMethod)
{ {
// Don't restrict by bitrate if coming from an external domain // Don't restrict bitrate if item is remote.
if (item.IsRemote) if (item.IsRemote)
{ {
return true; return true;
} }
long requestedMaxBitrate = maxBitrate > 0 ? maxBitrate : 1000000; // If no maximum bitrate is set, default to no maximum bitrate.
long requestedMaxBitrate = maxBitrate > 0 ? maxBitrate : int.MaxValue;
// If we don't know the bitrate, then force a transcode if requested max bitrate is under 40 mbps // If we don't know the item bitrate, then force a transcode if requested max bitrate is under 40 mbps
int itemBitrate = item.Bitrate ?? 40000000; int itemBitrate = item.Bitrate ?? 40000000;
if (itemBitrate > requestedMaxBitrate) if (itemBitrate > requestedMaxBitrate)