fix aac directstreaming

This commit is contained in:
nyanmisaka 2020-11-01 00:33:38 +08:00
parent 26078e4df9
commit d34be6faf4
2 changed files with 8 additions and 2 deletions

View File

@ -2675,9 +2675,10 @@ namespace MediaBrowser.Controller.MediaEncoding
state.MediaSource = mediaSource;
var request = state.BaseRequest;
if (!string.IsNullOrWhiteSpace(request.AudioCodec))
var supportedAudioCodecs = state.SupportedAudioCodecs;
if (request != null && supportedAudioCodecs != null && supportedAudioCodecs.Length > 0)
{
var supportedAudioCodecsList = request.AudioCodec.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList();
var supportedAudioCodecsList = supportedAudioCodecs.ToList();
ShiftAudioCodecsIfNeeded(supportedAudioCodecsList, state.AudioStream);

View File

@ -287,6 +287,11 @@ namespace MediaBrowser.Controller.MediaEncoding
return BaseRequest.AudioChannels;
}
if (BaseRequest.TranscodingMaxAudioChannels.HasValue)
{
return BaseRequest.TranscodingMaxAudioChannels;
}
if (!string.IsNullOrEmpty(codec))
{
var value = BaseRequest.GetOption(codec, "audiochannels");