remove tvos dts hack no longer needed

pull/702/head
Luke Pulverenti 8 years ago
parent 524e7facc8
commit de9cd28a79

@ -98,6 +98,9 @@ namespace Emby.Dlna.ContentDirectory
if (string.Equals(methodName, "Search", StringComparison.OrdinalIgnoreCase))
return HandleSearch(methodParams, user, deviceId).Result;
if (string.Equals(methodName, "X_BrowseByLetter", StringComparison.OrdinalIgnoreCase))
return HandleX_BrowseByLetter(methodParams, user, deviceId).Result;
throw new ResourceNotFoundException("Unexpected control request name: " + methodName);
}
@ -118,7 +121,7 @@ namespace Emby.Dlna.ContentDirectory
_userDataManager.SaveUserData(user.Id, item, userdata, UserDataSaveReason.TogglePlayed,
CancellationToken.None);
return new Dictionary<string,string>(StringComparer.OrdinalIgnoreCase);
return new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
private IEnumerable<KeyValuePair<string, string>> HandleGetSearchCapabilities()
@ -147,7 +150,7 @@ namespace Emby.Dlna.ContentDirectory
private IEnumerable<KeyValuePair<string, string>> HandleGetSystemUpdateID()
{
var headers = new Dictionary<string,string>(StringComparer.OrdinalIgnoreCase);
var headers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
headers.Add("Id", _systemUpdateId.ToString(_usCulture));
return headers;
}
@ -309,6 +312,12 @@ namespace Emby.Dlna.ContentDirectory
};
}
private Task<IEnumerable<KeyValuePair<string, string>>> HandleX_BrowseByLetter(IDictionary<string, string> sparams, User user, string deviceId)
{
// TODO: Implement this method
return HandleSearch(sparams, user, deviceId);
}
private async Task<IEnumerable<KeyValuePair<string, string>>> HandleSearch(IDictionary<string, string> sparams, User user, string deviceId)
{
var searchCriteria = new SearchCriteria(GetValueOrDefault(sparams, "SearchCriteria", ""));
@ -553,20 +562,6 @@ namespace Emby.Dlna.ContentDirectory
return result;
}
private bool EnablePeopleDisplay(BaseItem item)
{
if (_libraryManager.GetPeopleNames(new InternalPeopleQuery
{
ItemId = item.Id
}).Count > 0)
{
return item is Movie;
}
return false;
}
private ServerItem GetItemFromObjectId(string id, User user)
{
return DidlBuilder.IsIdRoot(id)

@ -207,8 +207,7 @@ namespace Emby.Dlna.Didl
streamInfo.TargetVideoStreamCount,
streamInfo.TargetAudioStreamCount,
streamInfo.TargetVideoCodecTag,
streamInfo.IsTargetAVC,
streamInfo.AllAudioCodecs);
streamInfo.IsTargetAVC);
foreach (var contentFeature in contentFeatureList)
{
@ -348,8 +347,7 @@ namespace Emby.Dlna.Didl
streamInfo.TargetVideoStreamCount,
streamInfo.TargetAudioStreamCount,
streamInfo.TargetVideoCodecTag,
streamInfo.IsTargetAVC,
streamInfo.AllAudioCodecs);
streamInfo.IsTargetAVC);
var filename = url.Substring(0, url.IndexOf('?'));

@ -541,8 +541,7 @@ namespace Emby.Dlna.PlayTo
streamInfo.TargetVideoStreamCount,
streamInfo.TargetAudioStreamCount,
streamInfo.TargetVideoCodecTag,
streamInfo.IsTargetAVC,
streamInfo.AllAudioCodecs);
streamInfo.IsTargetAVC);
return list.FirstOrDefault();
}

@ -2358,8 +2358,7 @@ namespace MediaBrowser.Api.Playback
state.TargetVideoStreamCount,
state.TargetAudioStreamCount,
state.TargetVideoCodecTag,
state.IsTargetAVC,
state.AllAudioCodecs);
state.IsTargetAVC);
if (mediaProfile != null)
{
@ -2581,8 +2580,7 @@ namespace MediaBrowser.Api.Playback
state.TargetVideoStreamCount,
state.TargetAudioStreamCount,
state.TargetVideoCodecTag,
state.IsTargetAVC,
state.AllAudioCodecs
state.IsTargetAVC
).FirstOrDefault() ?? string.Empty;
}

@ -245,17 +245,6 @@ namespace MediaBrowser.Api.Playback
public int? OutputAudioBitrate;
public int? OutputVideoBitrate;
public List<string> AllAudioCodecs
{
get
{
return MediaSource.MediaStreams.Where(i => i.Type == MediaStreamType.Audio)
.Select(i => i.Codec)
.Where(i => !string.IsNullOrWhiteSpace(i))
.ToList();
}
}
public string ActualOutputVideoCodec
{
get

@ -118,17 +118,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
}
}
public List<string> AllAudioCodecs
{
get
{
return MediaSource.MediaStreams.Where(i => i.Type == MediaStreamType.Audio)
.Select(i => i.Codec)
.Where(i => !string.IsNullOrWhiteSpace(i))
.ToList();
}
}
private void DisposeIsoMount()
{
if (IsoMount != null)

@ -846,8 +846,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
state.TargetVideoStreamCount,
state.TargetAudioStreamCount,
state.TargetVideoCodecTag,
state.IsTargetAVC,
state.AllAudioCodecs);
state.IsTargetAVC);
if (mediaProfile != null)
{

@ -24,15 +24,12 @@ namespace MediaBrowser.Model.Dlna
int? numVideoStreams,
int? numAudioStreams,
string videoCodecTag,
bool? isAvc,
List<string> allAudioCodecs )
bool? isAvc )
{
switch (condition.Property)
{
case ProfileConditionValue.IsAnamorphic:
return IsConditionSatisfied(condition, isAnamorphic);
case ProfileConditionValue.HasAudioCodec:
return IsHasAudioCodecConditionSatisfied(condition, allAudioCodecs);
case ProfileConditionValue.IsAvc:
return IsConditionSatisfied(condition, isAvc);
case ProfileConditionValue.VideoFramerate:
@ -167,25 +164,6 @@ namespace MediaBrowser.Model.Dlna
}
}
private bool IsHasAudioCodecConditionSatisfied(ProfileCondition condition, List<string> allAudioCodecs)
{
if (allAudioCodecs.Count == 0)
{
// If the value is unknown, it satisfies if not marked as required
return !condition.IsRequired;
}
switch (condition.Condition)
{
case ProfileConditionType.Equals:
return allAudioCodecs.Contains(condition.Value, StringComparer.Ordinal);
case ProfileConditionType.NotEquals:
return !allAudioCodecs.Contains(condition.Value, StringComparer.Ordinal);
default:
throw new InvalidOperationException("Unexpected ProfileConditionType");
}
}
private bool IsConditionSatisfied(ProfileCondition condition, bool? currentValue)
{
if (!currentValue.HasValue)

@ -119,8 +119,7 @@ namespace MediaBrowser.Model.Dlna
int? numVideoStreams,
int? numAudioStreams,
string videoCodecTag,
bool? isAvc,
List<string> allAudioCodecs)
bool? isAvc)
{
// first bit means Time based seek supported, second byte range seek supported (not sure about the order now), so 01 = only byte seek, 10 = time based, 11 = both, 00 = none
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetOrgOpValue(runtimeTicks.HasValue, isDirectStream, transcodeSeekInfo);
@ -162,8 +161,7 @@ namespace MediaBrowser.Model.Dlna
numVideoStreams,
numAudioStreams,
videoCodecTag,
isAvc,
allAudioCodecs);
isAvc);
List<string> orgPnValues = new List<string>();

@ -297,8 +297,7 @@ namespace MediaBrowser.Model.Dlna
int? numVideoStreams,
int? numAudioStreams,
string videoCodecTag,
bool? isAvc,
List<string> allAudioCodecs)
bool? isAvc)
{
container = StringHelper.TrimStart(container ?? string.Empty, '.');
@ -332,7 +331,7 @@ namespace MediaBrowser.Model.Dlna
var anyOff = false;
foreach (ProfileCondition c in i.Conditions)
{
if (!conditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs))
if (!conditionProcessor.IsVideoConditionSatisfied(GetModelProfileCondition(c), width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{
anyOff = true;
break;

@ -21,7 +21,6 @@
NumVideoStreams = 17,
IsSecondaryAudio = 18,
VideoCodecTag = 19,
IsAvc = 20,
HasAudioCodec = 21
IsAvc = 20
}
}

@ -411,7 +411,6 @@ namespace MediaBrowser.Model.Dlna
}
var allMediaStreams = item.MediaStreams;
var allAudioCodecs = allMediaStreams.Where(i => i.Type == MediaStreamType.Audio).Select(i => i.Codec).Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
MediaStream videoStream = item.VideoStream;
@ -556,7 +555,7 @@ namespace MediaBrowser.Model.Dlna
int? numAudioStreams = item.GetStreamCount(MediaStreamType.Audio);
int? numVideoStreams = item.GetStreamCount(MediaStreamType.Video);
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs))
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{
LogConditionFailure(options.Profile, "VideoCodecProfile", applyCondition, item);
applyConditions = false;
@ -739,12 +738,10 @@ namespace MediaBrowser.Model.Dlna
int? numAudioStreams = mediaSource.GetStreamCount(MediaStreamType.Audio);
int? numVideoStreams = mediaSource.GetStreamCount(MediaStreamType.Video);
var allAudioCodecs = allMediaStreams.Where(i => i.Type == MediaStreamType.Audio).Select(i => i.Codec).Where(i => !string.IsNullOrWhiteSpace(i)).ToList();
// Check container conditions
foreach (ProfileCondition i in conditions)
{
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs))
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{
LogConditionFailure(profile, "VideoContainerProfile", i, mediaSource);
@ -771,7 +768,7 @@ namespace MediaBrowser.Model.Dlna
bool applyConditions = true;
foreach (ProfileCondition applyCondition in i.ApplyConditions)
{
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs))
if (!conditionProcessor.IsVideoConditionSatisfied(applyCondition, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{
LogConditionFailure(profile, "VideoCodecProfile", applyCondition, mediaSource);
applyConditions = false;
@ -791,7 +788,7 @@ namespace MediaBrowser.Model.Dlna
foreach (ProfileCondition i in conditions)
{
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc, allAudioCodecs))
if (!conditionProcessor.IsVideoConditionSatisfied(i, width, height, bitDepth, videoBitrate, videoProfile, videoLevel, videoFramerate, packetLength, timestamp, isAnamorphic, refFrames, numVideoStreams, numAudioStreams, videoCodecTag, isAvc))
{
LogConditionFailure(profile, "VideoCodecProfile", i, mediaSource);

@ -413,17 +413,6 @@ namespace MediaBrowser.Model.Dlna
}
}
public List<string> AllAudioCodecs
{
get
{
return MediaSource.MediaStreams.Where(i => i.Type == MediaStreamType.Audio)
.Select(i => i.Codec)
.Where(i => !string.IsNullOrWhiteSpace(i))
.ToList();
}
}
/// <summary>
/// Returns the video stream that will be used
/// </summary>

Loading…
Cancel
Save