Force a remux/transcode with external audio files

pull/7035/head
cvium 2 years ago
parent cb41dda5b3
commit a7a7173cd5

@ -677,8 +677,8 @@ namespace MediaBrowser.Model.Dlna
var videoStream = item.VideoStream; var videoStream = item.VideoStream;
// TODO: This doesn't account for situations where the device is able to handle the media's bitrate, but the connection isn't fast enough // TODO: This doesn't account for situations where the device is able to handle the media's bitrate, but the connection isn't fast enough
var directPlayEligibilityResult = IsEligibleForDirectPlay(item, GetBitrateForDirectPlayCheck(item, options, true) ?? 0, subtitleStream, options, PlayMethod.DirectPlay); var directPlayEligibilityResult = IsEligibleForDirectPlay(item, GetBitrateForDirectPlayCheck(item, options, true) ?? 0, subtitleStream, audioStream, options, PlayMethod.DirectPlay);
var directStreamEligibilityResult = IsEligibleForDirectPlay(item, options.GetMaxBitrate(false) ?? 0, subtitleStream, options, PlayMethod.DirectStream); var directStreamEligibilityResult = IsEligibleForDirectPlay(item, options.GetMaxBitrate(false) ?? 0, subtitleStream, audioStream, options, PlayMethod.DirectStream);
bool isEligibleForDirectPlay = options.EnableDirectPlay && (options.ForceDirectPlay || directPlayEligibilityResult.Item1); bool isEligibleForDirectPlay = options.EnableDirectPlay && (options.ForceDirectPlay || directPlayEligibilityResult.Item1);
bool isEligibleForDirectStream = options.EnableDirectStream && (options.ForceDirectStream || directStreamEligibilityResult.Item1); bool isEligibleForDirectStream = options.EnableDirectStream && (options.ForceDirectStream || directStreamEligibilityResult.Item1);
@ -1213,6 +1213,7 @@ namespace MediaBrowser.Model.Dlna
MediaSourceInfo item, MediaSourceInfo item,
long maxBitrate, long maxBitrate,
MediaStream subtitleStream, MediaStream subtitleStream,
MediaStream audioStream,
VideoOptions options, VideoOptions options,
PlayMethod playMethod) PlayMethod playMethod)
{ {
@ -1228,8 +1229,17 @@ namespace MediaBrowser.Model.Dlna
} }
bool result = IsAudioEligibleForDirectPlay(item, maxBitrate, playMethod); bool result = IsAudioEligibleForDirectPlay(item, maxBitrate, playMethod);
if (!result)
{
return (false, TranscodeReason.ContainerBitrateExceedsLimit);
}
if (audioStream.IsExternal)
{
return (false, TranscodeReason.AudioIsExternal);
}
return (result, result ? null : TranscodeReason.ContainerBitrateExceedsLimit); return (true, null);
} }
public static SubtitleProfile GetSubtitleProfile( public static SubtitleProfile GetSubtitleProfile(

@ -26,6 +26,7 @@ namespace MediaBrowser.Model.Session
VideoProfileNotSupported = 19, VideoProfileNotSupported = 19,
AudioBitDepthNotSupported = 20, AudioBitDepthNotSupported = 20,
SubtitleCodecNotSupported = 21, SubtitleCodecNotSupported = 21,
DirectPlayError = 22 DirectPlayError = 22,
AudioIsExternal = 23
} }
} }

Loading…
Cancel
Save