change param type

pull/702/head
Luke Pulverenti 11 years ago
parent c3ce71bdc2
commit 9ee91faae4

@ -1,5 +1,4 @@
using MediaBrowser.Model.Configuration; using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -9,10 +8,10 @@ namespace MediaBrowser.Model.MediaInfo
{ {
public static class MediaStreamSelector public static class MediaStreamSelector
{ {
public static int? GetDefaultAudioStreamIndex(MediaSourceInfo mediaSource, IEnumerable<string> preferredLanguages, bool preferDefaultTrack) public static int? GetDefaultAudioStreamIndex(List<MediaStream> streams, IEnumerable<string> preferredLanguages, bool preferDefaultTrack)
{ {
var streams = GetSortedStreams(mediaSource.MediaStreams, MediaStreamType.Audio, preferredLanguages.FirstOrDefault()) streams = GetSortedStreams(streams, MediaStreamType.Audio, preferredLanguages.FirstOrDefault())
.ToList(); .ToList();
if (preferDefaultTrack) if (preferDefaultTrack)
{ {
@ -34,12 +33,12 @@ namespace MediaBrowser.Model.MediaInfo
return null; return null;
} }
public static int? GetDefaultSubtitleStreamIndex(MediaSourceInfo mediaSource, public static int? GetDefaultSubtitleStreamIndex(List<MediaStream> streams,
IEnumerable<string> preferredLanguages, IEnumerable<string> preferredLanguages,
SubtitlePlaybackMode mode, SubtitlePlaybackMode mode,
string audioTrackLanguage) string audioTrackLanguage)
{ {
var streams = GetSortedStreams(mediaSource.MediaStreams, MediaStreamType.Subtitle, preferredLanguages.FirstOrDefault()) streams = GetSortedStreams(streams, MediaStreamType.Subtitle, preferredLanguages.FirstOrDefault())
.ToList(); .ToList();
MediaStream stream = null; MediaStream stream = null;
@ -65,7 +64,7 @@ namespace MediaBrowser.Model.MediaInfo
return null; return null;
} }
private static IEnumerable<MediaStream> GetSortedStreams(IEnumerable<MediaStream> streams, MediaStreamType type, string defaultLanguage) private static IEnumerable<MediaStream> GetSortedStreams(IEnumerable<MediaStream> streams, MediaStreamType type, string defaultLanguage)
{ {
var orderStreams = streams var orderStreams = streams

Loading…
Cancel
Save