order streams by index before picking the one we want

This commit is contained in:
Luke Pulverenti 2013-05-22 12:54:35 -04:00
parent 697e98426f
commit 0cabe8808e

View File

@ -211,7 +211,7 @@ namespace MediaBrowser.Api.Playback
/// <returns>MediaStream.</returns>
private MediaStream GetMediaStream(IEnumerable<MediaStream> allStream, int? desiredIndex, MediaStreamType type, bool returnFirstIfNoIndex = true)
{
var streams = allStream.Where(s => s.Type == type).ToList();
var streams = allStream.Where(s => s.Type == type).OrderBy(i => i.Index).ToList();
if (desiredIndex.HasValue)
{