diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-08-05 21:09:03 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-08-05 21:09:03 -0400 |
| commit | 3ff3d04284429d78ec8adc2292de79ef0c022449 (patch) | |
| tree | 26b5daf7dc3699e4ab9bd41d416195fdbf9f869b /MediaBrowser.Model/Dlna | |
| parent | 3ba6364f259ea43979a88b2a83d64292119057dc (diff) | |
fixes #888 - Support m3u8 subtitle playlists
Diffstat (limited to 'MediaBrowser.Model/Dlna')
| -rw-r--r-- | MediaBrowser.Model/Dlna/DeviceProfile.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/StreamBuilder.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/StreamInfo.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/SubtitleProfile.cs | 3 |
4 files changed, 13 insertions, 10 deletions
diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs index 630e7fa604..5366a538c0 100644 --- a/MediaBrowser.Model/Dlna/DeviceProfile.cs +++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs @@ -90,8 +90,7 @@ namespace MediaBrowser.Model.Dlna public CodecProfile[] CodecProfiles { get; set; } public ResponseProfile[] ResponseProfiles { get; set; } - public SubtitleProfile[] SoftSubtitleProfiles { get; set; } - public SubtitleProfile[] ExternalSubtitleProfiles { get; set; } + public SubtitleProfile[] SubtitleProfiles { get; set; } public DeviceProfile() { @@ -100,9 +99,6 @@ namespace MediaBrowser.Model.Dlna ResponseProfiles = new ResponseProfile[] { }; CodecProfiles = new CodecProfile[] { }; ContainerProfiles = new ContainerProfile[] { }; - - SoftSubtitleProfiles = new SubtitleProfile[] { }; - ExternalSubtitleProfiles = new SubtitleProfile[] { }; XmlRootAttributes = new XmlAttribute[] { }; diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 22e817de15..72bf88b70d 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -518,7 +518,7 @@ namespace MediaBrowser.Model.Dlna { // See if the device can retrieve the subtitles externally bool supportsSubsExternally = options.Context == EncodingContext.Streaming && - ContainsSubtitleFormat(options.Profile.ExternalSubtitleProfiles, _serverTextSubtitleOutputs); + ContainsSubtitleFormat(options.Profile.SubtitleProfiles, SubtitleDeliveryMethod.External, _serverTextSubtitleOutputs); if (supportsSubsExternally) { @@ -526,7 +526,7 @@ namespace MediaBrowser.Model.Dlna } // See if the device can retrieve the subtitles externally - bool supportsEmbedded = ContainsSubtitleFormat(options.Profile.SoftSubtitleProfiles, _serverTextSubtitleOutputs); + bool supportsEmbedded = ContainsSubtitleFormat(options.Profile.SubtitleProfiles, SubtitleDeliveryMethod.Embed, _serverTextSubtitleOutputs); if (supportsEmbedded) { @@ -547,11 +547,11 @@ namespace MediaBrowser.Model.Dlna return codec; } - private bool ContainsSubtitleFormat(SubtitleProfile[] profiles, string[] formats) + private bool ContainsSubtitleFormat(SubtitleProfile[] profiles, SubtitleDeliveryMethod method, string[] formats) { foreach (SubtitleProfile profile in profiles) { - if (ListHelper.ContainsIgnoreCase(formats, profile.Format)) + if (method == profile.Method && ListHelper.ContainsIgnoreCase(formats, profile.Format)) { return true; } diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index 4f02d64508..f299a30c9b 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -476,6 +476,10 @@ namespace MediaBrowser.Model.Dlna /// <summary> /// The external /// </summary> - External = 2 + External = 2, + /// <summary> + /// The HLS + /// </summary> + Hls = 3 } } diff --git a/MediaBrowser.Model/Dlna/SubtitleProfile.cs b/MediaBrowser.Model/Dlna/SubtitleProfile.cs index 7aa5e17713..1895158357 100644 --- a/MediaBrowser.Model/Dlna/SubtitleProfile.cs +++ b/MediaBrowser.Model/Dlna/SubtitleProfile.cs @@ -9,5 +9,8 @@ namespace MediaBrowser.Model.Dlna [XmlAttribute("protocol")] public string Protocol { get; set; } + + [XmlAttribute("method")] + public SubtitleDeliveryMethod Method { get; set; } } }
\ No newline at end of file |
