From 9ee91faae4c7532e5a1adb26785b67b73710e635 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 12 May 2014 14:08:07 -0400 Subject: [PATCH] change param type --- .../MediaInfo/MediaStreamSelector.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/MediaBrowser.Model/MediaInfo/MediaStreamSelector.cs b/MediaBrowser.Model/MediaInfo/MediaStreamSelector.cs index d498c3a32a..39e32b43c8 100644 --- a/MediaBrowser.Model/MediaInfo/MediaStreamSelector.cs +++ b/MediaBrowser.Model/MediaInfo/MediaStreamSelector.cs @@ -1,5 +1,4 @@ using MediaBrowser.Model.Configuration; -using MediaBrowser.Model.Dto; using MediaBrowser.Model.Entities; using System; using System.Collections.Generic; @@ -9,10 +8,10 @@ namespace MediaBrowser.Model.MediaInfo { public static class MediaStreamSelector { - public static int? GetDefaultAudioStreamIndex(MediaSourceInfo mediaSource, IEnumerable preferredLanguages, bool preferDefaultTrack) + public static int? GetDefaultAudioStreamIndex(List streams, IEnumerable preferredLanguages, bool preferDefaultTrack) { - var streams = GetSortedStreams(mediaSource.MediaStreams, MediaStreamType.Audio, preferredLanguages.FirstOrDefault()) - .ToList(); + streams = GetSortedStreams(streams, MediaStreamType.Audio, preferredLanguages.FirstOrDefault()) + .ToList(); if (preferDefaultTrack) { @@ -34,12 +33,12 @@ namespace MediaBrowser.Model.MediaInfo return null; } - public static int? GetDefaultSubtitleStreamIndex(MediaSourceInfo mediaSource, - IEnumerable preferredLanguages, + public static int? GetDefaultSubtitleStreamIndex(List streams, + IEnumerable preferredLanguages, SubtitlePlaybackMode mode, string audioTrackLanguage) { - var streams = GetSortedStreams(mediaSource.MediaStreams, MediaStreamType.Subtitle, preferredLanguages.FirstOrDefault()) + streams = GetSortedStreams(streams, MediaStreamType.Subtitle, preferredLanguages.FirstOrDefault()) .ToList(); MediaStream stream = null; @@ -65,7 +64,7 @@ namespace MediaBrowser.Model.MediaInfo return null; } - + private static IEnumerable GetSortedStreams(IEnumerable streams, MediaStreamType type, string defaultLanguage) { var orderStreams = streams