commit
e169eaee6c
|
@ -131,6 +131,10 @@ namespace Emby.Server.Implementations.Data
|
||||||
{
|
{
|
||||||
queries.Add("PRAGMA temp_store = memory");
|
queries.Add("PRAGMA temp_store = memory");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
queries.Add("PRAGMA temp_store = file");
|
||||||
|
}
|
||||||
|
|
||||||
////foreach (var query in queries)
|
////foreach (var query in queries)
|
||||||
////{
|
////{
|
||||||
|
|
|
@ -779,7 +779,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
if (string.IsNullOrEmpty(container))
|
if (string.IsNullOrEmpty(container))
|
||||||
{
|
{
|
||||||
container = request.Static ?
|
container = request.Static ?
|
||||||
state.InputContainer :
|
StreamBuilder.NormalizeMediaSourceFormatIntoSingleContainer(state.InputContainer, null, DlnaProfileType.Audio) :
|
||||||
GetOutputFileExtension(state);
|
GetOutputFileExtension(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,11 @@ namespace MediaBrowser.Api.Playback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result.MediaSource != null)
|
||||||
|
{
|
||||||
|
NormalizeMediaSourceContainer(result.MediaSource, profile, DlnaProfileType.Video);
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,9 +212,22 @@ namespace MediaBrowser.Api.Playback
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (info.MediaSources != null)
|
||||||
|
{
|
||||||
|
foreach (var mediaSource in info.MediaSources)
|
||||||
|
{
|
||||||
|
NormalizeMediaSourceContainer(mediaSource, profile, DlnaProfileType.Video);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void NormalizeMediaSourceContainer(MediaSourceInfo mediaSource, DeviceProfile profile, DlnaProfileType type)
|
||||||
|
{
|
||||||
|
mediaSource.Container = StreamBuilder.NormalizeMediaSourceFormatIntoSingleContainer(mediaSource.Container, profile, type);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<object> Post(GetPostedPlaybackInfo request)
|
public async Task<object> Post(GetPostedPlaybackInfo request)
|
||||||
{
|
{
|
||||||
var result = await GetPlaybackInfo(request).ConfigureAwait(false);
|
var result = await GetPlaybackInfo(request).ConfigureAwait(false);
|
||||||
|
|
|
@ -167,7 +167,7 @@ namespace MediaBrowser.Api.Playback.Progressive
|
||||||
// Static stream
|
// Static stream
|
||||||
if (request.Static)
|
if (request.Static)
|
||||||
{
|
{
|
||||||
var contentType = state.GetMimeType(state.MediaPath);
|
var contentType = state.GetMimeType("." + state.OutputContainer, false) ?? state.GetMimeType(state.MediaPath);
|
||||||
|
|
||||||
using (state)
|
using (state)
|
||||||
{
|
{
|
||||||
|
|
|
@ -131,14 +131,14 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
public long? EncodingDurationTicks { get; set; }
|
public long? EncodingDurationTicks { get; set; }
|
||||||
|
|
||||||
public string GetMimeType(string outputPath)
|
public string GetMimeType(string outputPath, bool enableStreamDefault = true)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(MimeType))
|
if (!string.IsNullOrEmpty(MimeType))
|
||||||
{
|
{
|
||||||
return MimeType;
|
return MimeType;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MimeTypes.GetMimeType(outputPath);
|
return MimeTypes.GetMimeType(outputPath, enableStreamDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool EnableDlnaHeaders { get; set; }
|
public bool EnableDlnaHeaders { get; set; }
|
||||||
|
|
|
@ -48,22 +48,19 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string EmbyServiceName = "Emby";
|
||||||
public override double? GetDefaultPrimaryImageAspectRatio()
|
public override double? GetDefaultPrimaryImageAspectRatio()
|
||||||
{
|
{
|
||||||
if (IsMovie)
|
var serviceName = ServiceName;
|
||||||
|
if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName))
|
||||||
{
|
{
|
||||||
double value = 2;
|
return null;
|
||||||
value /= 3;
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
double value = 2;
|
|
||||||
value /= 3;
|
|
||||||
|
|
||||||
return value;
|
double value = 2;
|
||||||
}
|
value /= 3;
|
||||||
|
|
||||||
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
|
|
|
@ -10,6 +10,7 @@ using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
using MediaBrowser.Model.MediaInfo;
|
using MediaBrowser.Model.MediaInfo;
|
||||||
|
using MediaBrowser.Model.Extensions;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.MediaEncoding
|
namespace MediaBrowser.Controller.MediaEncoding
|
||||||
{
|
{
|
||||||
|
@ -148,10 +149,13 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
|
|
||||||
public string GetInputFormat(string container)
|
public string GetInputFormat(string container)
|
||||||
{
|
{
|
||||||
if (string.Equals(container, "mkv", StringComparison.OrdinalIgnoreCase))
|
if (string.IsNullOrWhiteSpace(container))
|
||||||
{
|
{
|
||||||
return "matroska";
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
container = container.Replace("mkv", "matroska", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
if (string.Equals(container, "ts", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(container, "ts", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return "mpegts";
|
return "mpegts";
|
||||||
|
@ -1694,7 +1698,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||||
state.InputAudioSync = "1";
|
state.InputAudioSync = "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.Equals(mediaSource.Container, "wma", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(mediaSource.Container, "wma", StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
string.Equals(mediaSource.Container, "asf", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
// Seeing some stuttering when transcoding wma to audio-only HLS
|
// Seeing some stuttering when transcoding wma to audio-only HLS
|
||||||
state.InputAudioSync = "1";
|
state.InputAudioSync = "1";
|
||||||
|
|
|
@ -53,7 +53,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||||
|
|
||||||
if (data.format != null)
|
if (data.format != null)
|
||||||
{
|
{
|
||||||
info.Container = data.format.format_name;
|
info.Container = NormalizeFormat(data.format.format_name);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(data.format.bit_rate))
|
if (!string.IsNullOrEmpty(data.format.bit_rate))
|
||||||
{
|
{
|
||||||
|
@ -195,6 +195,23 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string NormalizeFormat(string format)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(format))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (string.Equals(format, "mpegvideo", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return "mpeg";
|
||||||
|
}
|
||||||
|
|
||||||
|
format = format.Replace("matroska", "mkv", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
|
||||||
private int? GetEstimatedAudioBitrate(string codec, int? channels)
|
private int? GetEstimatedAudioBitrate(string codec, int? channels)
|
||||||
{
|
{
|
||||||
if (!channels.HasValue)
|
if (!channels.HasValue)
|
||||||
|
|
|
@ -42,16 +42,9 @@ namespace MediaBrowser.Model.Dlna
|
||||||
return SplitValue(Codec);
|
return SplitValue(Codec);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<string> GetContainers()
|
|
||||||
{
|
|
||||||
return SplitValue(Container);
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool ContainsContainer(string container)
|
private bool ContainsContainer(string container)
|
||||||
{
|
{
|
||||||
List<string> containers = GetContainers();
|
return ContainerProfile.ContainsContainer(Container, container);
|
||||||
|
|
||||||
return containers.Count == 0 || ListHelper.ContainsIgnoreCase(containers, container ?? string.Empty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ContainsCodec(string codec, string container)
|
public bool ContainsCodec(string codec, string container)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System.Collections.Generic;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using MediaBrowser.Model.Dlna;
|
using MediaBrowser.Model.Dlna;
|
||||||
using MediaBrowser.Model.Extensions;
|
using MediaBrowser.Model.Extensions;
|
||||||
|
@ -20,11 +21,16 @@ namespace MediaBrowser.Model.Dlna
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<string> GetContainers()
|
public List<string> GetContainers()
|
||||||
|
{
|
||||||
|
return SplitValue(Container);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<string> SplitValue(string value)
|
||||||
{
|
{
|
||||||
List<string> list = new List<string>();
|
List<string> list = new List<string>();
|
||||||
foreach (string i in (Container ?? string.Empty).Split(','))
|
foreach (string i in (value ?? string.Empty).Split(','))
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(i)) list.Add(i);
|
if (!string.IsNullOrWhiteSpace(i)) list.Add(i);
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +39,32 @@ namespace MediaBrowser.Model.Dlna
|
||||||
{
|
{
|
||||||
List<string> containers = GetContainers();
|
List<string> containers = GetContainers();
|
||||||
|
|
||||||
return containers.Count == 0 || ListHelper.ContainsIgnoreCase(containers, container ?? string.Empty);
|
return ContainsContainer(containers, container);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool ContainsContainer(string profileContainers, string inputContainer)
|
||||||
|
{
|
||||||
|
return ContainsContainer(SplitValue(profileContainers), inputContainer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool ContainsContainer(List<string> profileContainers, string inputContainer)
|
||||||
|
{
|
||||||
|
if (profileContainers.Count == 0)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
var allInputContainers = SplitValue(inputContainer);
|
||||||
|
|
||||||
|
foreach (var container in allInputContainers)
|
||||||
|
{
|
||||||
|
if (ListHelper.ContainsIgnoreCase(profileContainers, container))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,17 +187,14 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
|
public ResponseProfile GetAudioMediaProfile(string container, string audioCodec, int? audioChannels, int? audioBitrate, int? audioSampleRate, int? audioBitDepth)
|
||||||
{
|
{
|
||||||
container = StringHelper.TrimStart(container ?? string.Empty, '.');
|
|
||||||
|
|
||||||
foreach (var i in ResponseProfiles)
|
foreach (var i in ResponseProfiles)
|
||||||
{
|
{
|
||||||
if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Audio)
|
if (i.Type != DlnaProfileType.Audio)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> containers = i.GetContainers();
|
if (!ContainerProfile.ContainsContainer(i.GetContainers(), container))
|
||||||
if (containers.Count > 0 && !ListHelper.ContainsIgnoreCase(containers, container))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -208,7 +205,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var conditionProcessor = new MediaBrowser.Model.Dlna.ConditionProcessor();
|
var conditionProcessor = new ConditionProcessor();
|
||||||
|
|
||||||
var anyOff = false;
|
var anyOff = false;
|
||||||
foreach (ProfileCondition c in i.Conditions)
|
foreach (ProfileCondition c in i.Conditions)
|
||||||
|
@ -230,9 +227,9 @@ namespace MediaBrowser.Model.Dlna
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private MediaBrowser.Model.Dlna.ProfileCondition GetModelProfileCondition(ProfileCondition c)
|
private ProfileCondition GetModelProfileCondition(ProfileCondition c)
|
||||||
{
|
{
|
||||||
return new MediaBrowser.Model.Dlna.ProfileCondition
|
return new ProfileCondition
|
||||||
{
|
{
|
||||||
Condition = c.Condition,
|
Condition = c.Condition,
|
||||||
IsRequired = c.IsRequired,
|
IsRequired = c.IsRequired,
|
||||||
|
@ -243,22 +240,19 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
public ResponseProfile GetImageMediaProfile(string container, int? width, int? height)
|
public ResponseProfile GetImageMediaProfile(string container, int? width, int? height)
|
||||||
{
|
{
|
||||||
container = StringHelper.TrimStart(container ?? string.Empty, '.');
|
|
||||||
|
|
||||||
foreach (var i in ResponseProfiles)
|
foreach (var i in ResponseProfiles)
|
||||||
{
|
{
|
||||||
if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Photo)
|
if (i.Type != DlnaProfileType.Photo)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> containers = i.GetContainers();
|
if (!ContainerProfile.ContainsContainer(i.GetContainers(), container))
|
||||||
if (containers.Count > 0 && !ListHelper.ContainsIgnoreCase(containers, container))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var conditionProcessor = new MediaBrowser.Model.Dlna.ConditionProcessor();
|
var conditionProcessor = new ConditionProcessor();
|
||||||
|
|
||||||
var anyOff = false;
|
var anyOff = false;
|
||||||
foreach (ProfileCondition c in i.Conditions)
|
foreach (ProfileCondition c in i.Conditions)
|
||||||
|
@ -300,17 +294,14 @@ namespace MediaBrowser.Model.Dlna
|
||||||
string videoCodecTag,
|
string videoCodecTag,
|
||||||
bool? isAvc)
|
bool? isAvc)
|
||||||
{
|
{
|
||||||
container = StringHelper.TrimStart(container ?? string.Empty, '.');
|
|
||||||
|
|
||||||
foreach (var i in ResponseProfiles)
|
foreach (var i in ResponseProfiles)
|
||||||
{
|
{
|
||||||
if (i.Type != MediaBrowser.Model.Dlna.DlnaProfileType.Video)
|
if (i.Type != DlnaProfileType.Video)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<string> containers = i.GetContainers();
|
if (!ContainerProfile.ContainsContainer(i.GetContainers(), container))
|
||||||
if (containers.Count > 0 && !ListHelper.ContainsIgnoreCase(containers, container ?? string.Empty))
|
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -327,7 +318,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var conditionProcessor = new MediaBrowser.Model.Dlna.ConditionProcessor();
|
var conditionProcessor = new ConditionProcessor();
|
||||||
|
|
||||||
var anyOff = false;
|
var anyOff = false;
|
||||||
foreach (ProfileCondition c in i.Conditions)
|
foreach (ProfileCondition c in i.Conditions)
|
||||||
|
|
|
@ -19,27 +19,9 @@ namespace MediaBrowser.Model.Dlna
|
||||||
[XmlAttribute("type")]
|
[XmlAttribute("type")]
|
||||||
public DlnaProfileType Type { get; set; }
|
public DlnaProfileType Type { get; set; }
|
||||||
|
|
||||||
public List<string> GetContainers()
|
|
||||||
{
|
|
||||||
List<string> list = new List<string>();
|
|
||||||
foreach (string i in (Container ?? string.Empty).Split(','))
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(i)) list.Add(i);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool SupportsContainer(string container)
|
public bool SupportsContainer(string container)
|
||||||
{
|
{
|
||||||
var all = GetContainers();
|
return ContainerProfile.ContainsContainer(Container, container);
|
||||||
|
|
||||||
// Only allow unknown container if the profile is all inclusive
|
|
||||||
if (string.IsNullOrWhiteSpace(container))
|
|
||||||
{
|
|
||||||
return all.Count == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return all.Count == 0 || all.Contains(container, StringComparer.OrdinalIgnoreCase);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<string> GetAudioCodecs()
|
public List<string> GetAudioCodecs()
|
||||||
|
|
|
@ -33,12 +33,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
public List<string> GetContainers()
|
public List<string> GetContainers()
|
||||||
{
|
{
|
||||||
List<string> list = new List<string>();
|
return ContainerProfile.SplitValue(Container);
|
||||||
foreach (string i in (Container ?? string.Empty).Split(','))
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(i)) list.Add(i);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<string> GetAudioCodecs()
|
public List<string> GetAudioCodecs()
|
||||||
|
|
|
@ -197,6 +197,40 @@ namespace MediaBrowser.Model.Dlna
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string NormalizeMediaSourceFormatIntoSingleContainer(string inputContainer, DeviceProfile profile, DlnaProfileType type)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(inputContainer))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var formats = ContainerProfile.SplitValue(inputContainer);
|
||||||
|
|
||||||
|
if (formats.Count == 1)
|
||||||
|
{
|
||||||
|
return formats[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile != null)
|
||||||
|
{
|
||||||
|
foreach (var format in formats)
|
||||||
|
{
|
||||||
|
foreach (var directPlayProfile in profile.DirectPlayProfiles)
|
||||||
|
{
|
||||||
|
if (directPlayProfile.Type == type)
|
||||||
|
{
|
||||||
|
if (directPlayProfile.SupportsContainer(format))
|
||||||
|
{
|
||||||
|
return format;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return formats[0];
|
||||||
|
}
|
||||||
|
|
||||||
private StreamInfo BuildAudioItem(MediaSourceInfo item, AudioOptions options)
|
private StreamInfo BuildAudioItem(MediaSourceInfo item, AudioOptions options)
|
||||||
{
|
{
|
||||||
List<TranscodeReason> transcodeReasons = new List<TranscodeReason>();
|
List<TranscodeReason> transcodeReasons = new List<TranscodeReason>();
|
||||||
|
@ -214,14 +248,14 @@ namespace MediaBrowser.Model.Dlna
|
||||||
if (options.ForceDirectPlay)
|
if (options.ForceDirectPlay)
|
||||||
{
|
{
|
||||||
playlistItem.PlayMethod = PlayMethod.DirectPlay;
|
playlistItem.PlayMethod = PlayMethod.DirectPlay;
|
||||||
playlistItem.Container = item.Container;
|
playlistItem.Container = NormalizeMediaSourceFormatIntoSingleContainer(item.Container, options.Profile, DlnaProfileType.Audio);
|
||||||
return playlistItem;
|
return playlistItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.ForceDirectStream)
|
if (options.ForceDirectStream)
|
||||||
{
|
{
|
||||||
playlistItem.PlayMethod = PlayMethod.DirectStream;
|
playlistItem.PlayMethod = PlayMethod.DirectStream;
|
||||||
playlistItem.Container = item.Container;
|
playlistItem.Container = NormalizeMediaSourceFormatIntoSingleContainer(item.Container, options.Profile, DlnaProfileType.Audio);
|
||||||
return playlistItem;
|
return playlistItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -295,7 +329,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
playlistItem.PlayMethod = PlayMethod.DirectStream;
|
playlistItem.PlayMethod = PlayMethod.DirectStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
playlistItem.Container = item.Container;
|
playlistItem.Container = NormalizeMediaSourceFormatIntoSingleContainer(item.Container, options.Profile, DlnaProfileType.Audio);
|
||||||
|
|
||||||
return playlistItem;
|
return playlistItem;
|
||||||
}
|
}
|
||||||
|
@ -648,7 +682,7 @@ namespace MediaBrowser.Model.Dlna
|
||||||
if (directPlay != null)
|
if (directPlay != null)
|
||||||
{
|
{
|
||||||
playlistItem.PlayMethod = directPlay.Value;
|
playlistItem.PlayMethod = directPlay.Value;
|
||||||
playlistItem.Container = item.Container;
|
playlistItem.Container = NormalizeMediaSourceFormatIntoSingleContainer(item.Container, options.Profile, DlnaProfileType.Video);
|
||||||
|
|
||||||
if (subtitleStream != null)
|
if (subtitleStream != null)
|
||||||
{
|
{
|
||||||
|
@ -1231,21 +1265,27 @@ namespace MediaBrowser.Model.Dlna
|
||||||
|
|
||||||
private static bool IsSubtitleEmbedSupported(MediaStream subtitleStream, SubtitleProfile subtitleProfile, string transcodingSubProtocol, string transcodingContainer)
|
private static bool IsSubtitleEmbedSupported(MediaStream subtitleStream, SubtitleProfile subtitleProfile, string transcodingSubProtocol, string transcodingContainer)
|
||||||
{
|
{
|
||||||
if (string.Equals(transcodingContainer, "ts", StringComparison.OrdinalIgnoreCase))
|
if (!string.IsNullOrWhiteSpace(transcodingContainer))
|
||||||
{
|
{
|
||||||
return false;
|
var normalizedContainers = ContainerProfile.SplitValue(transcodingContainer);
|
||||||
}
|
|
||||||
if (string.Equals(transcodingContainer, "mpegts", StringComparison.OrdinalIgnoreCase))
|
if (ContainerProfile.ContainsContainer(normalizedContainers, "ts"))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (string.Equals(transcodingContainer, "mp4", StringComparison.OrdinalIgnoreCase))
|
if (ContainerProfile.ContainsContainer(normalizedContainers, "mpegts"))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (string.Equals(transcodingContainer, "mkv", StringComparison.OrdinalIgnoreCase))
|
if (ContainerProfile.ContainsContainer(normalizedContainers, "mp4"))
|
||||||
{
|
{
|
||||||
return true;
|
return false;
|
||||||
|
}
|
||||||
|
if (ContainerProfile.ContainsContainer(normalizedContainers, "mkv") ||
|
||||||
|
ContainerProfile.ContainsContainer(normalizedContainers, "matroska"))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -1572,14 +1612,17 @@ namespace MediaBrowser.Model.Dlna
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check audio codec
|
// Check audio codec
|
||||||
List<string> audioCodecs = profile.GetAudioCodecs();
|
if (audioStream != null)
|
||||||
if (audioCodecs.Count > 0)
|
|
||||||
{
|
{
|
||||||
// Check audio codecs
|
List<string> audioCodecs = profile.GetAudioCodecs();
|
||||||
string audioCodec = audioStream == null ? null : audioStream.Codec;
|
if (audioCodecs.Count > 0)
|
||||||
if (string.IsNullOrEmpty(audioCodec) || !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec))
|
|
||||||
{
|
{
|
||||||
return false;
|
// Check audio codecs
|
||||||
|
string audioCodec = audioStream == null ? null : audioStream.Codec;
|
||||||
|
if (string.IsNullOrEmpty(audioCodec) || !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,14 +106,15 @@ namespace MediaBrowser.Model.Net
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string GetMimeType(string path)
|
||||||
|
{
|
||||||
|
return GetMimeType(path, true);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the type of the MIME.
|
/// Gets the type of the MIME.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="path">The path.</param>
|
public static string GetMimeType(string path, bool enableStreamDefault)
|
||||||
/// <returns>System.String.</returns>
|
|
||||||
/// <exception cref="ArgumentNullException">path</exception>
|
|
||||||
/// <exception cref="InvalidOperationException">Argument not supported: + path</exception>
|
|
||||||
public static string GetMimeType(string path)
|
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(path))
|
if (string.IsNullOrEmpty(path))
|
||||||
{
|
{
|
||||||
|
@ -329,7 +330,12 @@ namespace MediaBrowser.Model.Net
|
||||||
return "application/ttml+xml";
|
return "application/ttml+xml";
|
||||||
}
|
}
|
||||||
|
|
||||||
return "application/octet-stream";
|
if (enableStreamDefault)
|
||||||
|
{
|
||||||
|
return "application/octet-stream";
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string ToExtension(string mimeType)
|
public static string ToExtension(string mimeType)
|
||||||
|
|
|
@ -95,14 +95,14 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
{
|
{
|
||||||
var mediaStreams = mediaInfo.MediaStreams;
|
var mediaStreams = mediaInfo.MediaStreams;
|
||||||
|
|
||||||
//audio.FormatName = mediaInfo.Container;
|
audio.Container = mediaInfo.Container;
|
||||||
audio.TotalBitrate = mediaInfo.Bitrate;
|
audio.TotalBitrate = mediaInfo.Bitrate;
|
||||||
|
|
||||||
audio.RunTimeTicks = mediaInfo.RunTimeTicks;
|
audio.RunTimeTicks = mediaInfo.RunTimeTicks;
|
||||||
audio.Size = mediaInfo.Size;
|
audio.Size = mediaInfo.Size;
|
||||||
|
|
||||||
var extension = (Path.GetExtension(audio.Path) ?? string.Empty).TrimStart('.');
|
var extension = (Path.GetExtension(audio.Path) ?? string.Empty).TrimStart('.');
|
||||||
audio.Container = extension;
|
//audio.Container = extension;
|
||||||
|
|
||||||
await FetchDataFromTags(audio, mediaInfo).ConfigureAwait(false);
|
await FetchDataFromTags(audio, mediaInfo).ConfigureAwait(false);
|
||||||
|
|
||||||
|
|
|
@ -187,6 +187,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
{
|
{
|
||||||
video.Container = null;
|
video.Container = null;
|
||||||
}
|
}
|
||||||
|
video.Container = mediaInfo.Container;
|
||||||
|
|
||||||
var chapters = mediaInfo.Chapters ?? new List<ChapterInfo>();
|
var chapters = mediaInfo.Chapters ?? new List<ChapterInfo>();
|
||||||
if (blurayInfo != null)
|
if (blurayInfo != null)
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.2.26.13")]
|
[assembly: AssemblyVersion("3.2.26.14")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user