mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
filter audio streams that don't have any channels
This commit is contained in:
parent
517006a620
commit
14e28f9eb2
@ -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…
x
Reference in New Issue
Block a user