diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-24 22:45:06 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-24 22:45:06 -0400 |
| commit | 1544b7bf9ce3221aec47da22a76e171f6714ce26 (patch) | |
| tree | a737f44f8cf44162ff264887c0b234cf17c6023e /MediaBrowser.Model | |
| parent | eca1ba0b12da195dff3c31ffb799e4e3a7b5b5b9 (diff) | |
display timestamp info
Diffstat (limited to 'MediaBrowser.Model')
| -rw-r--r-- | MediaBrowser.Model/Dlna/ConditionProcessor.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs | 10 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/StreamBuilder.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/StreamInfo.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dto/MediaVersionInfo.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs | 6 |
6 files changed, 21 insertions, 15 deletions
diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs index 2e337982fc..3577c6f018 100644 --- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs +++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs @@ -18,7 +18,7 @@ namespace MediaBrowser.Model.Dlna double? videoLevel, double? videoFramerate, int? packetLength, - TransportStreamTimestamp timestamp) + TransportStreamTimestamp? timestamp) { switch (condition.Property) { @@ -176,8 +176,14 @@ namespace MediaBrowser.Model.Dlna return false; } - private bool IsConditionSatisfied(ProfileCondition condition, TransportStreamTimestamp timestamp) + private bool IsConditionSatisfied(ProfileCondition condition, TransportStreamTimestamp? timestamp) { + if (!timestamp.HasValue) + { + // If the value is unknown, it satisfies if not marked as required + return !condition.IsRequired; + } + var expected = (TransportStreamTimestamp)Enum.Parse(typeof(TransportStreamTimestamp), condition.Value, true); switch (condition.Condition) diff --git a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs index 589dc33766..a62508fb1a 100644 --- a/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs +++ b/MediaBrowser.Model/Dlna/MediaFormatProfileResolver.cs @@ -67,10 +67,10 @@ namespace MediaBrowser.Model.Dlna switch (timestampType) { - case TransportStreamTimestamp.NONE: + case TransportStreamTimestamp.None: suffix = "_ISO"; break; - case TransportStreamTimestamp.VALID: + case TransportStreamTimestamp.Valid: suffix = "_T"; break; } @@ -89,7 +89,7 @@ namespace MediaBrowser.Model.Dlna list.Add(ValueOf("MPEG_TS_SD_EU" + suffix)); list.Add(ValueOf("MPEG_TS_SD_KO" + suffix)); - if ((timestampType == TransportStreamTimestamp.VALID) && string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase)) + if ((timestampType == TransportStreamTimestamp.Valid) && string.Equals(audioCodec, "aac", StringComparison.OrdinalIgnoreCase)) { list.Add(MediaFormatProfile.MPEG_TS_JP_T); } @@ -102,7 +102,7 @@ namespace MediaBrowser.Model.Dlna if (string.Equals(audioCodec, "dts", StringComparison.OrdinalIgnoreCase)) { - if (timestampType == TransportStreamTimestamp.NONE) + if (timestampType == TransportStreamTimestamp.None) { return new[] { MediaFormatProfile.AVC_TS_HD_DTS_ISO }; } @@ -111,7 +111,7 @@ namespace MediaBrowser.Model.Dlna if (string.Equals(audioCodec, "mp3", StringComparison.OrdinalIgnoreCase)) { - if (timestampType == TransportStreamTimestamp.NONE) + if (timestampType == TransportStreamTimestamp.None) { return new[] { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_ISO", resolution)) }; } diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 13c698dedf..40b1e140b1 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -286,7 +286,7 @@ namespace MediaBrowser.Model.Dlna var audioBitrate = audioStream == null ? null : audioStream.BitRate; var audioChannels = audioStream == null ? null : audioStream.Channels; - var timestamp = videoStream == null ? TransportStreamTimestamp.NONE : mediaSource.Timestamp; + var timestamp = videoStream == null ? TransportStreamTimestamp.None : mediaSource.Timestamp; var packetLength = videoStream == null ? null : videoStream.PacketLength; // Check container conditions diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs index e49c319476..1e8ca6f20c 100644 --- a/MediaBrowser.Model/Dlna/StreamInfo.cs +++ b/MediaBrowser.Model/Dlna/StreamInfo.cs @@ -341,12 +341,12 @@ namespace MediaBrowser.Model.Dlna get { var defaultValue = string.Equals(Container, "m2ts", StringComparison.OrdinalIgnoreCase) - ? TransportStreamTimestamp.VALID - : TransportStreamTimestamp.NONE; + ? TransportStreamTimestamp.Valid + : TransportStreamTimestamp.None; return !IsDirectStream ? defaultValue - : MediaSource == null ? defaultValue : MediaSource.Timestamp; + : MediaSource == null ? defaultValue : MediaSource.Timestamp ?? TransportStreamTimestamp.None; } } diff --git a/MediaBrowser.Model/Dto/MediaVersionInfo.cs b/MediaBrowser.Model/Dto/MediaVersionInfo.cs index e2b197213a..c2215fd6a6 100644 --- a/MediaBrowser.Model/Dto/MediaVersionInfo.cs +++ b/MediaBrowser.Model/Dto/MediaVersionInfo.cs @@ -31,7 +31,7 @@ namespace MediaBrowser.Model.Dto public int? Bitrate { get; set; } - public TransportStreamTimestamp Timestamp { get; set; } + public TransportStreamTimestamp? Timestamp { get; set; } public MediaSourceInfo() { diff --git a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs index 35000ca398..01e75e6f8c 100644 --- a/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs +++ b/MediaBrowser.Model/MediaInfo/BlurayDiscInfo.cs @@ -37,8 +37,8 @@ namespace MediaBrowser.Model.MediaInfo public enum TransportStreamTimestamp { - NONE, - ZERO, - VALID + None, + Zero, + Valid } } |
