mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-11 18:20:23 +01:00
display timestamp info
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)) };
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -37,8 +37,8 @@ namespace MediaBrowser.Model.MediaInfo
|
||||
|
||||
public enum TransportStreamTimestamp
|
||||
{
|
||||
NONE,
|
||||
ZERO,
|
||||
VALID
|
||||
None,
|
||||
Zero,
|
||||
Valid
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user