|
|
@ -383,7 +383,7 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
|
|
|
|
|
|
|
if (subtitleStream != null)
|
|
|
|
if (subtitleStream != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, options.Context);
|
|
|
|
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, options.Context, directPlay.Value);
|
|
|
|
|
|
|
|
|
|
|
|
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
|
|
|
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
|
|
|
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
|
|
|
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
|
|
@ -413,7 +413,7 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
|
|
|
|
|
|
|
|
if (subtitleStream != null)
|
|
|
|
if (subtitleStream != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, options.Context);
|
|
|
|
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, options.Context, PlayMethod.Transcode);
|
|
|
|
|
|
|
|
|
|
|
|
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
|
|
|
playlistItem.SubtitleDeliveryMethod = subtitleProfile.Method;
|
|
|
|
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
|
|
|
playlistItem.SubtitleFormat = subtitleProfile.Format;
|
|
|
@ -711,7 +711,7 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (subtitleStream != null)
|
|
|
|
if (subtitleStream != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, options.Context);
|
|
|
|
SubtitleProfile subtitleProfile = GetSubtitleProfile(subtitleStream, options.Profile.SubtitleProfiles, options.Context, playMethod);
|
|
|
|
|
|
|
|
|
|
|
|
if (subtitleProfile.Method != SubtitleDeliveryMethod.External && subtitleProfile.Method != SubtitleDeliveryMethod.Embed)
|
|
|
|
if (subtitleProfile.Method != SubtitleDeliveryMethod.External && subtitleProfile.Method != SubtitleDeliveryMethod.Embed)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -723,8 +723,25 @@ namespace MediaBrowser.Model.Dlna
|
|
|
|
return IsAudioEligibleForDirectPlay(item, maxBitrate);
|
|
|
|
return IsAudioEligibleForDirectPlay(item, maxBitrate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static SubtitleProfile GetSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, EncodingContext context)
|
|
|
|
public static SubtitleProfile GetSubtitleProfile(MediaStream subtitleStream, SubtitleProfile[] subtitleProfiles, EncodingContext context, PlayMethod playMethod)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (playMethod != PlayMethod.Transcode)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Look for supported embedded subs
|
|
|
|
|
|
|
|
foreach (SubtitleProfile profile in subtitleProfiles)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!profile.SupportsLanguage(subtitleStream.Language))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (profile.Method == SubtitleDeliveryMethod.Embed && subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return profile;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Look for an external profile that matches the stream type (text/graphical)
|
|
|
|
// Look for an external profile that matches the stream type (text/graphical)
|
|
|
|
foreach (SubtitleProfile profile in subtitleProfiles)
|
|
|
|
foreach (SubtitleProfile profile in subtitleProfiles)
|
|
|
|
{
|
|
|
|
{
|
|
|
|