|
|
|
@ -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,24 +750,27 @@ 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 (!requiresConversion)
|
|
|
|
|
if (subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format))
|
|
|
|
|
{
|
|
|
|
|
return profile;
|
|
|
|
|
}
|
|
|
|
|
bool requiresConversion = !StringHelper.EqualsIgnoreCase(subtitleStream.Codec, profile.Format);
|
|
|
|
|
|
|
|
|
|
if (subtitleStream.IsTextSubtitleStream || !requiresConversion)
|
|
|
|
|
{
|
|
|
|
|
if (subtitleStream.SupportsExternalStream)
|
|
|
|
|
{
|
|
|
|
|
return profile;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// For sync we can handle the longer extraction times
|
|
|
|
|
if (context == EncodingContext.Static && subtitleStream.IsTextSubtitleStream)
|
|
|
|
|