aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-20 11:48:44 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-09-20 11:48:44 -0400
commitb6046835834aac85b134b29b4b3ae1d8ae3160be (patch)
treeea46cc314395b4bdf7b2906dfc28877683148baf
parent9db6f610c65592a299173248a8352252f07e5fdb (diff)
update StreamBuilder
-rw-r--r--MediaBrowser.Model/Dlna/StreamBuilder.cs33
1 files changed, 18 insertions, 15 deletions
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index e0cc1b705..0335c43f0 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -157,7 +157,7 @@ namespace MediaBrowser.Model.Dlna
if (all)
{
if (item.Protocol == MediaProtocol.File &&
- directPlayMethods.Contains(PlayMethod.DirectPlay) &&
+ directPlayMethods.Contains(PlayMethod.DirectPlay) &&
_localPlayer.CanAccessFile(item.Path))
{
playlistItem.PlayMethod = PlayMethod.DirectPlay;
@@ -288,7 +288,7 @@ namespace MediaBrowser.Model.Dlna
{
_logger.Debug("Profile: {0}, No direct play profiles found for Path: {1}",
options.Profile.Name ?? "Unknown Profile",
- item.Path ?? "Unknown path");
+ item.Path ?? "Unknown path");
}
return playMethods;
@@ -306,7 +306,7 @@ namespace MediaBrowser.Model.Dlna
{
highestScore = stream.Score.Value;
}
- }
+ }
}
List<MediaStream> topStreams = new List<MediaStream>();
@@ -540,8 +540,8 @@ namespace MediaBrowser.Model.Dlna
{
_logger.Debug("Profile: {0}, No direct play profiles found for Path: {1}",
profile.Name ?? "Unknown Profile",
- mediaSource.Path ?? "Unknown path");
-
+ mediaSource.Path ?? "Unknown path");
+
return null;
}
@@ -658,7 +658,7 @@ namespace MediaBrowser.Model.Dlna
if (!conditionProcessor.IsVideoAudioConditionSatisfied(i, audioChannels, audioBitrate, audioProfile, isSecondaryAudio))
{
LogConditionFailure(profile, "VideoAudioCodecProfile", i, mediaSource);
-
+
return null;
}
}
@@ -725,7 +725,7 @@ namespace MediaBrowser.Model.Dlna
public static SubtitleProfile GetSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, EncodingContext context, PlayMethod playMethod)
{
- if (playMethod != PlayMethod.Transcode)
+ if (playMethod != PlayMethod.Transcode && !subtitleStream.IsExternal)
{
// Look for supported embedded subs
foreach (SubtitleProfile profile in subtitleProfiles)
@@ -750,23 +750,26 @@ namespace MediaBrowser.Model.Dlna
// Look for an external profile that matches the stream type (text/graphical)
foreach (SubtitleProfile profile in subtitleProfiles)
{
- bool requiresConversion = !StringHelper.EqualsIgnoreCase(subtitleStream.Codec, profile.Format);
+ if (profile.Method != SubtitleDeliveryMethod.External)
+ {
+ continue;
+ }
if (!profile.SupportsLanguage(subtitleStream.Language))
{
continue;
}
- if (profile.Method == SubtitleDeliveryMethod.External && subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format))
+ if (subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format))
{
- if (!requiresConversion)
- {
- return profile;
- }
+ bool requiresConversion = !StringHelper.EqualsIgnoreCase(subtitleStream.Codec, profile.Format);
- if (subtitleStream.SupportsExternalStream)
+ if (subtitleStream.IsTextSubtitleStream || !requiresConversion)
{
- return profile;
+ if (subtitleStream.SupportsExternalStream)
+ {
+ return profile;
+ }
}
// For sync we can handle the longer extraction times