mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-15 06:36:37 +00:00
Merge pull request #9418 from Bond-009/getawaiter
This commit is contained in:
@@ -44,32 +44,24 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
ValidateMediaOptions(options, false);
|
||||
|
||||
var mediaSources = new List<MediaSourceInfo>();
|
||||
var streams = new List<StreamInfo>();
|
||||
foreach (var mediaSource in options.MediaSources)
|
||||
{
|
||||
if (string.IsNullOrEmpty(options.MediaSourceId)
|
||||
|| string.Equals(mediaSource.Id, options.MediaSourceId, StringComparison.OrdinalIgnoreCase))
|
||||
if (!(string.IsNullOrEmpty(options.MediaSourceId)
|
||||
|| string.Equals(mediaSource.Id, options.MediaSourceId, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
mediaSources.Add(mediaSource);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
var streams = new List<StreamInfo>();
|
||||
foreach (var mediaSourceInfo in mediaSources)
|
||||
{
|
||||
StreamInfo? streamInfo = GetOptimalAudioStream(mediaSourceInfo, options);
|
||||
StreamInfo? streamInfo = GetOptimalAudioStream(mediaSource, options);
|
||||
if (streamInfo is not null)
|
||||
{
|
||||
streamInfo.DeviceId = options.DeviceId;
|
||||
streamInfo.DeviceProfileId = options.Profile.Id;
|
||||
streams.Add(streamInfo);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var stream in streams)
|
||||
{
|
||||
stream.DeviceId = options.DeviceId;
|
||||
stream.DeviceProfileId = options.Profile.Id;
|
||||
}
|
||||
|
||||
return GetOptimalStream(streams, options.GetMaxBitrate(true) ?? 0);
|
||||
}
|
||||
|
||||
@@ -399,7 +391,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
return (null, null, GetTranscodeReasonsFromDirectPlayProfile(item, null, audioStream, options.Profile.DirectPlayProfiles));
|
||||
}
|
||||
|
||||
var playMethods = new List<PlayMethod>();
|
||||
TranscodeReason transcodeReasons = 0;
|
||||
|
||||
// The profile describes what the device supports
|
||||
|
||||
Reference in New Issue
Block a user