filter audio streams that don't have any channels

This commit is contained in:
Luke Pulverenti 2013-08-28 18:18:14 -04:00
parent 517006a620
commit 14e28f9eb2

View File

@ -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;
}