Merge pull request #1940 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2016-07-13 16:50:51 -04:00 committed by GitHub
commit 36d43a2d29
6 changed files with 23 additions and 1 deletions

View File

@ -1568,6 +1568,13 @@ namespace MediaBrowser.Api.Playback
{ {
request.TranscodingMaxAudioChannels = int.Parse(val, UsCulture); request.TranscodingMaxAudioChannels = int.Parse(val, UsCulture);
} }
else if (i == 28)
{
if (videoRequest != null)
{
videoRequest.EnableSubtitlesInManifest = string.Equals("true", val, StringComparison.OrdinalIgnoreCase);
}
}
} }
} }
@ -2140,6 +2147,7 @@ namespace MediaBrowser.Api.Playback
{ {
state.VideoRequest.CopyTimestamps = transcodingProfile.CopyTimestamps; state.VideoRequest.CopyTimestamps = transcodingProfile.CopyTimestamps;
state.VideoRequest.ForceLiveStream = transcodingProfile.ForceLiveStream; state.VideoRequest.ForceLiveStream = transcodingProfile.ForceLiveStream;
state.VideoRequest.EnableSubtitlesInManifest = transcodingProfile.EnableSubtitlesInManifest;
} }
} }
} }

View File

@ -525,10 +525,16 @@ namespace MediaBrowser.Api.Playback.Hls
var subtitleGroup = subtitleStreams.Count > 0 && var subtitleGroup = subtitleStreams.Count > 0 &&
request is GetMasterHlsVideoPlaylist && request is GetMasterHlsVideoPlaylist &&
((GetMasterHlsVideoPlaylist)request).SubtitleMethod == SubtitleDeliveryMethod.Hls ? (state.VideoRequest.SubtitleMethod == SubtitleDeliveryMethod.Hls || state.VideoRequest.EnableSubtitlesInManifest) ?
"subs" : "subs" :
null; null;
// If we're burning in subtitles then don't add additional subs to the manifest
if (state.SubtitleStream != null && state.VideoRequest.SubtitleMethod == SubtitleDeliveryMethod.Encode)
{
subtitleGroup = null;
}
if (!string.IsNullOrWhiteSpace(subtitleGroup)) if (!string.IsNullOrWhiteSpace(subtitleGroup))
{ {
AddSubtitles(state, subtitleStreams, builder); AddSubtitles(state, subtitleStreams, builder);

View File

@ -194,6 +194,8 @@ namespace MediaBrowser.Api.Playback
public bool ForceLiveStream { get; set; } public bool ForceLiveStream { get; set; }
public bool EnableSubtitlesInManifest { get; set; }
public VideoStreamRequest() public VideoStreamRequest()
{ {
EnableAutoStreamCopy = true; EnableAutoStreamCopy = true;

View File

@ -480,6 +480,7 @@ namespace MediaBrowser.Model.Dlna
playlistItem.VideoCodec = transcodingProfile.VideoCodec; playlistItem.VideoCodec = transcodingProfile.VideoCodec;
playlistItem.CopyTimestamps = transcodingProfile.CopyTimestamps; playlistItem.CopyTimestamps = transcodingProfile.CopyTimestamps;
playlistItem.ForceLiveStream = transcodingProfile.ForceLiveStream; playlistItem.ForceLiveStream = transcodingProfile.ForceLiveStream;
playlistItem.EnableSubtitlesInManifest = transcodingProfile.EnableSubtitlesInManifest;
if (!string.IsNullOrEmpty(transcodingProfile.MaxAudioChannels)) if (!string.IsNullOrEmpty(transcodingProfile.MaxAudioChannels))
{ {

View File

@ -37,6 +37,7 @@ namespace MediaBrowser.Model.Dlna
public bool CopyTimestamps { get; set; } public bool CopyTimestamps { get; set; }
public bool ForceLiveStream { get; set; } public bool ForceLiveStream { get; set; }
public bool EnableSubtitlesInManifest { get; set; }
public string[] AudioCodecs { get; set; } public string[] AudioCodecs { get; set; }
public int? AudioStreamIndex { get; set; } public int? AudioStreamIndex { get; set; }
@ -249,6 +250,7 @@ namespace MediaBrowser.Model.Dlna
list.Add(new NameValuePair("SubtitleMethod", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External ? item.SubtitleDeliveryMethod.ToString() : string.Empty)); list.Add(new NameValuePair("SubtitleMethod", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External ? item.SubtitleDeliveryMethod.ToString() : string.Empty));
list.Add(new NameValuePair("TranscodingMaxAudioChannels", item.TranscodingMaxAudioChannels.HasValue ? StringHelper.ToStringCultureInvariant(item.TranscodingMaxAudioChannels.Value) : string.Empty)); list.Add(new NameValuePair("TranscodingMaxAudioChannels", item.TranscodingMaxAudioChannels.HasValue ? StringHelper.ToStringCultureInvariant(item.TranscodingMaxAudioChannels.Value) : string.Empty));
list.Add(new NameValuePair("EnableSubtitlesInManifest", item.EnableSubtitlesInManifest.ToString().ToLower()));
return list; return list;
} }

View File

@ -38,6 +38,9 @@ namespace MediaBrowser.Model.Dlna
[XmlAttribute("forceLiveStream")] [XmlAttribute("forceLiveStream")]
public bool ForceLiveStream { get; set; } public bool ForceLiveStream { get; set; }
[XmlAttribute("enableSubtitlesInManifest")]
public bool EnableSubtitlesInManifest { get; set; }
[XmlAttribute("maxAudioChannels")] [XmlAttribute("maxAudioChannels")]
public string MaxAudioChannels { get; set; } public string MaxAudioChannels { get; set; }