diff options
| author | gnattu <gnattuoc@me.com> | 2024-07-17 13:35:53 +0800 |
|---|---|---|
| committer | gnattu <gnattuoc@me.com> | 2024-07-17 13:35:59 +0800 |
| commit | ed9d27bb3a5fb2b187c453dcc2c572b7123f4beb (patch) | |
| tree | d2ab917708b360799de499ad470a4d47d08f57e8 | |
| parent | f840d9b60f886ce618e88efb5526532b620054bb (diff) | |
Correctly set bitrate limit for remuxing
Signed-off-by: gnattu <gnattuoc@me.com>
| -rw-r--r-- | MediaBrowser.Model/Dlna/StreamBuilder.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 20d9cd8d5..c6509035c 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -419,6 +419,7 @@ namespace MediaBrowser.Model.Dlna var directPlayProfile = options.Profile.DirectPlayProfiles .FirstOrDefault(x => x.Type == DlnaProfileType.Audio && IsAudioDirectPlaySupported(x, item, audioStream)); + TranscodeReason transcodeReasons = 0; if (directPlayProfile is null) { _logger.LogDebug( @@ -432,17 +433,20 @@ namespace MediaBrowser.Model.Dlna if (directStreamProfile is not null) { - return (directStreamProfile, PlayMethod.DirectStream, TranscodeReason.ContainerNotSupported); + directPlayProfile = directStreamProfile; + transcodeReasons |= TranscodeReason.ContainerNotSupported; + } + else + { + return (null, null, GetTranscodeReasonsFromDirectPlayProfile(item, null, audioStream, options.Profile.DirectPlayProfiles)); } - - return (null, null, GetTranscodeReasonsFromDirectPlayProfile(item, null, audioStream, options.Profile.DirectPlayProfiles)); } - TranscodeReason transcodeReasons = 0; - // The profile describes what the device supports // If device requirements are satisfied then allow both direct stream and direct play - if (item.SupportsDirectPlay) + // Note: As of 10.10 codebase, SupportsDirectPlay is always true because the MediaSourceInfo initializes this key as true + // Need to check additionally for current transcode reasons + if (item.SupportsDirectPlay && transcodeReasons == 0) { if (!IsBitrateLimitExceeded(item, options.GetMaxBitrate(true) ?? 0)) { |
