mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 09:04:42 +01:00
Merge pull request #11126 from crobibero/lowercase-protocol
Lowercase MediaStreamProtocol for backwards compatibility
This commit is contained in:
@@ -557,7 +557,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
private static void SetStreamInfoOptionsFromDirectPlayProfile(MediaOptions options, MediaSourceInfo item, StreamInfo playlistItem, DirectPlayProfile? directPlayProfile)
|
||||
{
|
||||
var container = NormalizeMediaSourceFormatIntoSingleContainer(item.Container, options.Profile, DlnaProfileType.Video, directPlayProfile);
|
||||
var protocol = MediaStreamProtocol.Http;
|
||||
var protocol = MediaStreamProtocol.http;
|
||||
|
||||
item.TranscodingContainer = container;
|
||||
item.TranscodingSubProtocol = protocol;
|
||||
@@ -648,7 +648,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (directPlay == PlayMethod.DirectPlay)
|
||||
{
|
||||
playlistItem.SubProtocol = MediaStreamProtocol.Http;
|
||||
playlistItem.SubProtocol = MediaStreamProtocol.http;
|
||||
|
||||
var audioStreamIndex = directPlayInfo.AudioStreamIndex ?? audioStream?.Index;
|
||||
if (audioStreamIndex.HasValue)
|
||||
@@ -803,7 +803,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
var videoCodecs = ContainerProfile.SplitValue(videoCodec);
|
||||
|
||||
// Enforce HLS video codec restrictions
|
||||
if (playlistItem.SubProtocol == MediaStreamProtocol.Hls)
|
||||
if (playlistItem.SubProtocol == MediaStreamProtocol.hls)
|
||||
{
|
||||
videoCodecs = videoCodecs.Where(codec => _supportedHlsVideoCodecs.Contains(codec)).ToArray();
|
||||
}
|
||||
@@ -840,7 +840,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
var audioCodecs = ContainerProfile.SplitValue(audioCodec);
|
||||
|
||||
// Enforce HLS audio codec restrictions
|
||||
if (playlistItem.SubProtocol == MediaStreamProtocol.Hls)
|
||||
if (playlistItem.SubProtocol == MediaStreamProtocol.hls)
|
||||
{
|
||||
if (string.Equals(playlistItem.Container, "mp4", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -1360,7 +1360,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
string? outputContainer,
|
||||
MediaStreamProtocol? transcodingSubProtocol)
|
||||
{
|
||||
if (!subtitleStream.IsExternal && (playMethod != PlayMethod.Transcode || transcodingSubProtocol != MediaStreamProtocol.Hls))
|
||||
if (!subtitleStream.IsExternal && (playMethod != PlayMethod.Transcode || transcodingSubProtocol != MediaStreamProtocol.hls))
|
||||
{
|
||||
// Look for supported embedded subs of the same format
|
||||
foreach (var profile in subtitleProfiles)
|
||||
|
||||
@@ -670,7 +670,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (MediaType == DlnaProfileType.Audio)
|
||||
{
|
||||
if (SubProtocol == MediaStreamProtocol.Hls)
|
||||
if (SubProtocol == MediaStreamProtocol.hls)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}/audio/{1}/master.m3u8?{2}", baseUrl, ItemId, queryString);
|
||||
}
|
||||
@@ -678,7 +678,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}/audio/{1}/stream{2}?{3}", baseUrl, ItemId, extension, queryString);
|
||||
}
|
||||
|
||||
if (SubProtocol == MediaStreamProtocol.Hls)
|
||||
if (SubProtocol == MediaStreamProtocol.hls)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}/videos/{1}/master.m3u8?{2}", baseUrl, ItemId, queryString);
|
||||
}
|
||||
@@ -716,7 +716,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
long startPositionTicks = item.StartPositionTicks;
|
||||
|
||||
if (item.SubProtocol == MediaStreamProtocol.Hls)
|
||||
if (item.SubProtocol == MediaStreamProtocol.hls)
|
||||
{
|
||||
list.Add(new NameValuePair("StartTimeTicks", string.Empty));
|
||||
}
|
||||
@@ -778,7 +778,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
list.Add(new NameValuePair("SubtitleCodec", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Embed ? subtitleCodecs : string.Empty));
|
||||
|
||||
if (item.SubProtocol == MediaStreamProtocol.Hls)
|
||||
if (item.SubProtocol == MediaStreamProtocol.hls)
|
||||
{
|
||||
list.Add(new NameValuePair("SegmentContainer", item.Container ?? string.Empty));
|
||||
|
||||
@@ -829,7 +829,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
var list = new List<SubtitleStreamInfo>();
|
||||
|
||||
// HLS will preserve timestamps so we can just grab the full subtitle stream
|
||||
long startPositionTicks = SubProtocol == MediaStreamProtocol.Hls
|
||||
long startPositionTicks = SubProtocol == MediaStreamProtocol.hls
|
||||
? 0
|
||||
: (PlayMethod == PlayMethod.Transcode && !CopyTimestamps ? StartPositionTicks : 0);
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
public string AudioCodec { get; set; } = string.Empty;
|
||||
|
||||
[XmlAttribute("protocol")]
|
||||
public MediaStreamProtocol Protocol { get; set; } = MediaStreamProtocol.Http;
|
||||
public MediaStreamProtocol Protocol { get; set; } = MediaStreamProtocol.http;
|
||||
|
||||
[DefaultValue(false)]
|
||||
[XmlAttribute("estimateContentLength")]
|
||||
|
||||
Reference in New Issue
Block a user