mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-10-20 15:54:38 +00:00
filter audio streams that don't have any channels
This commit is contained in:
parent
517006a620
commit
14e28f9eb2
1 changed files with 7 additions and 1 deletions
|
|
@ -114,7 +114,7 @@ namespace MediaBrowser.Api.Playback
|
|||
}
|
||||
|
||||
protected readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The fast seek offset seconds
|
||||
/// </summary>
|
||||
|
|
@ -227,6 +227,12 @@ namespace MediaBrowser.Api.Playback
|
|||
}
|
||||
}
|
||||
|
||||
if (returnFirstIfNoIndex && type == MediaStreamType.Audio)
|
||||
{
|
||||
return streams.FirstOrDefault(i => i.Channels.HasValue && i.Channels.Value > 0) ??
|
||||
streams.FirstOrDefault();
|
||||
}
|
||||
|
||||
// Just return the first one
|
||||
return returnFirstIfNoIndex ? streams.FirstOrDefault() : null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue