mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-12 10:40:24 +01:00
ReSharper conform to 'var' settings
This commit is contained in:
@@ -164,7 +164,7 @@ namespace BDInfo
|
||||
if (DirectoryPLAYLIST != null)
|
||||
{
|
||||
FileSystemMetadata[] files = GetFiles(DirectoryPLAYLIST.FullName, ".mpls").ToArray();
|
||||
foreach (FileSystemMetadata file in files)
|
||||
foreach (var file in files)
|
||||
{
|
||||
PlaylistFiles.Add(
|
||||
file.Name.ToUpper(), new TSPlaylistFile(this, file, _fileSystem, textEncoding));
|
||||
@@ -174,7 +174,7 @@ namespace BDInfo
|
||||
if (DirectorySTREAM != null)
|
||||
{
|
||||
FileSystemMetadata[] files = GetFiles(DirectorySTREAM.FullName, ".m2ts").ToArray();
|
||||
foreach (FileSystemMetadata file in files)
|
||||
foreach (var file in files)
|
||||
{
|
||||
StreamFiles.Add(
|
||||
file.Name.ToUpper(), new TSStreamFile(file, _fileSystem));
|
||||
@@ -184,7 +184,7 @@ namespace BDInfo
|
||||
if (DirectoryCLIPINF != null)
|
||||
{
|
||||
FileSystemMetadata[] files = GetFiles(DirectoryCLIPINF.FullName, ".clpi").ToArray();
|
||||
foreach (FileSystemMetadata file in files)
|
||||
foreach (var file in files)
|
||||
{
|
||||
StreamClipFiles.Add(
|
||||
file.Name.ToUpper(), new TSStreamClipFile(file, _fileSystem, textEncoding));
|
||||
@@ -194,7 +194,7 @@ namespace BDInfo
|
||||
if (DirectorySSIF != null)
|
||||
{
|
||||
FileSystemMetadata[] files = GetFiles(DirectorySSIF.FullName, ".ssif").ToArray();
|
||||
foreach (FileSystemMetadata file in files)
|
||||
foreach (var file in files)
|
||||
{
|
||||
InterleavedFiles.Add(
|
||||
file.Name.ToUpper(), new TSInterleavedFile(file));
|
||||
@@ -214,8 +214,8 @@ namespace BDInfo
|
||||
|
||||
public void Scan()
|
||||
{
|
||||
List<TSStreamClipFile> errorStreamClipFiles = new List<TSStreamClipFile>();
|
||||
foreach (TSStreamClipFile streamClipFile in StreamClipFiles.Values)
|
||||
var errorStreamClipFiles = new List<TSStreamClipFile>();
|
||||
foreach (var streamClipFile in StreamClipFiles.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -239,7 +239,7 @@ namespace BDInfo
|
||||
}
|
||||
}
|
||||
|
||||
foreach (TSStreamFile streamFile in StreamFiles.Values)
|
||||
foreach (var streamFile in StreamFiles.Values)
|
||||
{
|
||||
string ssifName = Path.GetFileNameWithoutExtension(streamFile.Name) + ".SSIF";
|
||||
if (InterleavedFiles.ContainsKey(ssifName))
|
||||
@@ -252,8 +252,8 @@ namespace BDInfo
|
||||
StreamFiles.Values.CopyTo(streamFiles, 0);
|
||||
Array.Sort(streamFiles, CompareStreamFiles);
|
||||
|
||||
List<TSPlaylistFile> errorPlaylistFiles = new List<TSPlaylistFile>();
|
||||
foreach (TSPlaylistFile playlistFile in PlaylistFiles.Values)
|
||||
var errorPlaylistFiles = new List<TSPlaylistFile>();
|
||||
foreach (var playlistFile in PlaylistFiles.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -277,15 +277,15 @@ namespace BDInfo
|
||||
}
|
||||
}
|
||||
|
||||
List<TSStreamFile> errorStreamFiles = new List<TSStreamFile>();
|
||||
foreach (TSStreamFile streamFile in streamFiles)
|
||||
var errorStreamFiles = new List<TSStreamFile>();
|
||||
foreach (var streamFile in streamFiles)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<TSPlaylistFile> playlists = new List<TSPlaylistFile>();
|
||||
foreach (TSPlaylistFile playlist in PlaylistFiles.Values)
|
||||
var playlists = new List<TSPlaylistFile>();
|
||||
foreach (var playlist in PlaylistFiles.Values)
|
||||
{
|
||||
foreach (TSStreamClip streamClip in playlist.StreamClips)
|
||||
foreach (var streamClip in playlist.StreamClips)
|
||||
{
|
||||
if (streamClip.Name == streamFile.Name)
|
||||
{
|
||||
@@ -314,12 +314,12 @@ namespace BDInfo
|
||||
}
|
||||
}
|
||||
|
||||
foreach (TSPlaylistFile playlistFile in PlaylistFiles.Values)
|
||||
foreach (var playlistFile in PlaylistFiles.Values)
|
||||
{
|
||||
playlistFile.Initialize();
|
||||
if (!Is50Hz)
|
||||
{
|
||||
foreach (TSVideoStream videoStream in playlistFile.VideoStreams)
|
||||
foreach (var videoStream in playlistFile.VideoStreams)
|
||||
{
|
||||
if (videoStream.FrameRate == TSFrameRate.FRAMERATE_25 ||
|
||||
videoStream.FrameRate == TSFrameRate.FRAMERATE_50)
|
||||
@@ -339,7 +339,7 @@ namespace BDInfo
|
||||
throw new ArgumentNullException(nameof(path));
|
||||
}
|
||||
|
||||
FileSystemMetadata dir = _fileSystem.GetDirectoryInfo(path);
|
||||
var dir = _fileSystem.GetDirectoryInfo(path);
|
||||
|
||||
while (dir != null)
|
||||
{
|
||||
@@ -369,7 +369,7 @@ namespace BDInfo
|
||||
if (dir != null)
|
||||
{
|
||||
FileSystemMetadata[] children = _fileSystem.GetDirectories(dir.FullName).ToArray();
|
||||
foreach (FileSystemMetadata child in children)
|
||||
foreach (var child in children)
|
||||
{
|
||||
if (string.Equals(child.Name, name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
@@ -378,7 +378,7 @@ namespace BDInfo
|
||||
}
|
||||
if (searchDepth > 0)
|
||||
{
|
||||
foreach (FileSystemMetadata child in children)
|
||||
foreach (var child in children)
|
||||
{
|
||||
GetDirectory(
|
||||
name, child, searchDepth - 1);
|
||||
@@ -395,7 +395,7 @@ namespace BDInfo
|
||||
//if (!ExcludeDirs.Contains(directoryInfo.Name.ToUpper())) // TODO: Keep?
|
||||
{
|
||||
FileSystemMetadata[] pathFiles = _fileSystem.GetFiles(directoryInfo.FullName).ToArray();
|
||||
foreach (FileSystemMetadata pathFile in pathFiles)
|
||||
foreach (var pathFile in pathFiles)
|
||||
{
|
||||
if (pathFile.Extension.ToUpper() == ".SSIF")
|
||||
{
|
||||
@@ -405,7 +405,7 @@ namespace BDInfo
|
||||
}
|
||||
|
||||
FileSystemMetadata[] pathChildren = _fileSystem.GetDirectories(directoryInfo.FullName).ToArray();
|
||||
foreach (FileSystemMetadata pathChild in pathChildren)
|
||||
foreach (var pathChild in pathChildren)
|
||||
{
|
||||
size += GetDirectorySize(pathChild);
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace BDInfo
|
||||
// TODO
|
||||
if (stream.CoreStream != null)
|
||||
{
|
||||
TSAudioStream coreStream = (TSAudioStream)stream.CoreStream;
|
||||
var coreStream = (TSAudioStream)stream.CoreStream;
|
||||
if (coreStream.AudioMode == TSAudioMode.Extended &&
|
||||
stream.ChannelCount == 5)
|
||||
{
|
||||
|
||||
@@ -85,9 +85,9 @@ namespace BDInfo
|
||||
_fileSystem = fileSystem;
|
||||
_textEncoding = textEncoding;
|
||||
IsCustom = true;
|
||||
foreach (TSStreamClip clip in clips)
|
||||
foreach (var clip in clips)
|
||||
{
|
||||
TSStreamClip newClip = new TSStreamClip(
|
||||
var newClip = new TSStreamClip(
|
||||
clip.StreamFile, clip.StreamClipFile);
|
||||
|
||||
newClip.Name = clip.Name;
|
||||
@@ -123,7 +123,7 @@ namespace BDInfo
|
||||
get
|
||||
{
|
||||
ulong size = 0;
|
||||
foreach (TSStreamClip clip in StreamClips)
|
||||
foreach (var clip in StreamClips)
|
||||
{
|
||||
size += clip.InterleavedFileSize;
|
||||
}
|
||||
@@ -135,7 +135,7 @@ namespace BDInfo
|
||||
get
|
||||
{
|
||||
ulong size = 0;
|
||||
foreach (TSStreamClip clip in StreamClips)
|
||||
foreach (var clip in StreamClips)
|
||||
{
|
||||
size += clip.FileSize;
|
||||
}
|
||||
@@ -147,7 +147,7 @@ namespace BDInfo
|
||||
get
|
||||
{
|
||||
double length = 0;
|
||||
foreach (TSStreamClip clip in StreamClips)
|
||||
foreach (var clip in StreamClips)
|
||||
{
|
||||
if (clip.AngleIndex == 0)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ namespace BDInfo
|
||||
get
|
||||
{
|
||||
double length = 0;
|
||||
foreach (TSStreamClip clip in StreamClips)
|
||||
foreach (var clip in StreamClips)
|
||||
{
|
||||
length += clip.Length;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ namespace BDInfo
|
||||
get
|
||||
{
|
||||
ulong size = 0;
|
||||
foreach (TSStreamClip clip in StreamClips)
|
||||
foreach (var clip in StreamClips)
|
||||
{
|
||||
if (clip.AngleIndex == 0)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ namespace BDInfo
|
||||
get
|
||||
{
|
||||
ulong size = 0;
|
||||
foreach (TSStreamClip clip in StreamClips)
|
||||
foreach (var clip in StreamClips)
|
||||
{
|
||||
size += clip.PacketSize;
|
||||
}
|
||||
@@ -263,7 +263,7 @@ namespace BDInfo
|
||||
int itemCount = ReadInt16(data, ref pos);
|
||||
int subitemCount = ReadInt16(data, ref pos);
|
||||
|
||||
List<TSStreamClip> chapterClips = new List<TSStreamClip>();
|
||||
var chapterClips = new List<TSStreamClip>();
|
||||
for (int itemIndex = 0; itemIndex < itemCount; itemIndex++)
|
||||
{
|
||||
int itemStart = pos;
|
||||
@@ -310,7 +310,7 @@ namespace BDInfo
|
||||
if (outTime < 0) outTime &= 0x7FFFFFFF;
|
||||
double timeOut = (double)outTime / 45000;
|
||||
|
||||
TSStreamClip streamClip = new TSStreamClip(
|
||||
var streamClip = new TSStreamClip(
|
||||
streamFile, streamClipFile);
|
||||
|
||||
streamClip.Name = streamFileName; //TODO
|
||||
@@ -361,7 +361,7 @@ namespace BDInfo
|
||||
FileInfo.Name, angleClipFileName));
|
||||
}
|
||||
|
||||
TSStreamClip angleClip =
|
||||
var angleClip =
|
||||
new TSStreamClip(angleFile, angleClipFile);
|
||||
angleClip.AngleIndex = angle + 1;
|
||||
angleClip.TimeIn = streamClip.TimeIn;
|
||||
@@ -394,33 +394,33 @@ namespace BDInfo
|
||||
|
||||
for (int i = 0; i < streamCountVideo; i++)
|
||||
{
|
||||
TSStream stream = CreatePlaylistStream(data, ref pos);
|
||||
var stream = CreatePlaylistStream(data, ref pos);
|
||||
if (stream != null) PlaylistStreams[stream.PID] = stream;
|
||||
}
|
||||
for (int i = 0; i < streamCountAudio; i++)
|
||||
{
|
||||
TSStream stream = CreatePlaylistStream(data, ref pos);
|
||||
var stream = CreatePlaylistStream(data, ref pos);
|
||||
if (stream != null) PlaylistStreams[stream.PID] = stream;
|
||||
}
|
||||
for (int i = 0; i < streamCountPG; i++)
|
||||
{
|
||||
TSStream stream = CreatePlaylistStream(data, ref pos);
|
||||
var stream = CreatePlaylistStream(data, ref pos);
|
||||
if (stream != null) PlaylistStreams[stream.PID] = stream;
|
||||
}
|
||||
for (int i = 0; i < streamCountIG; i++)
|
||||
{
|
||||
TSStream stream = CreatePlaylistStream(data, ref pos);
|
||||
var stream = CreatePlaylistStream(data, ref pos);
|
||||
if (stream != null) PlaylistStreams[stream.PID] = stream;
|
||||
}
|
||||
for (int i = 0; i < streamCountSecondaryAudio; i++)
|
||||
{
|
||||
TSStream stream = CreatePlaylistStream(data, ref pos);
|
||||
var stream = CreatePlaylistStream(data, ref pos);
|
||||
if (stream != null) PlaylistStreams[stream.PID] = stream;
|
||||
pos += 2;
|
||||
}
|
||||
for (int i = 0; i < streamCountSecondaryVideo; i++)
|
||||
{
|
||||
TSStream stream = CreatePlaylistStream(data, ref pos);
|
||||
var stream = CreatePlaylistStream(data, ref pos);
|
||||
if (stream != null) PlaylistStreams[stream.PID] = stream;
|
||||
pos += 6;
|
||||
}
|
||||
@@ -458,7 +458,7 @@ namespace BDInfo
|
||||
((long)data[pos + 6] << 8) +
|
||||
((long)data[pos + 7]);
|
||||
|
||||
TSStreamClip streamClip = chapterClips[streamFileIndex];
|
||||
var streamClip = chapterClips[streamFileIndex];
|
||||
|
||||
double chapterSeconds = (double)chapterTime / 45000;
|
||||
|
||||
@@ -498,8 +498,8 @@ namespace BDInfo
|
||||
{
|
||||
LoadStreamClips();
|
||||
|
||||
Dictionary<string, List<double>> clipTimes = new Dictionary<string, List<double>>();
|
||||
foreach (TSStreamClip clip in StreamClips)
|
||||
var clipTimes = new Dictionary<string, List<double>>();
|
||||
foreach (var clip in StreamClips)
|
||||
{
|
||||
if (clip.AngleIndex == 0)
|
||||
{
|
||||
@@ -567,7 +567,7 @@ namespace BDInfo
|
||||
int streamLength = data[pos++];
|
||||
int streamPos = pos;
|
||||
|
||||
TSStreamType streamType = (TSStreamType)data[pos++];
|
||||
var streamType = (TSStreamType)data[pos++];
|
||||
switch (streamType)
|
||||
{
|
||||
case TSStreamType.MVC_VIDEO:
|
||||
@@ -579,11 +579,11 @@ namespace BDInfo
|
||||
case TSStreamType.MPEG2_VIDEO:
|
||||
case TSStreamType.VC1_VIDEO:
|
||||
|
||||
TSVideoFormat videoFormat = (TSVideoFormat)
|
||||
var videoFormat = (TSVideoFormat)
|
||||
(data[pos] >> 4);
|
||||
TSFrameRate frameRate = (TSFrameRate)
|
||||
var frameRate = (TSFrameRate)
|
||||
(data[pos] & 0xF);
|
||||
TSAspectRatio aspectRatio = (TSAspectRatio)
|
||||
var aspectRatio = (TSAspectRatio)
|
||||
(data[pos + 1] >> 4);
|
||||
|
||||
stream = new TSVideoStream();
|
||||
@@ -617,9 +617,9 @@ namespace BDInfo
|
||||
|
||||
int audioFormat = ReadByte(data, ref pos);
|
||||
|
||||
TSChannelLayout channelLayout = (TSChannelLayout)
|
||||
var channelLayout = (TSChannelLayout)
|
||||
(audioFormat >> 4);
|
||||
TSSampleRate sampleRate = (TSSampleRate)
|
||||
var sampleRate = (TSSampleRate)
|
||||
(audioFormat & 0xF);
|
||||
|
||||
string audioLanguage = ReadString(data, 3, ref pos);
|
||||
@@ -712,7 +712,7 @@ namespace BDInfo
|
||||
{
|
||||
referenceClip = StreamClips[0];
|
||||
}
|
||||
foreach (TSStreamClip clip in StreamClips)
|
||||
foreach (var clip in StreamClips)
|
||||
{
|
||||
if (clip.StreamClipFile.Streams.Count > referenceClip.StreamClipFile.Streams.Count)
|
||||
{
|
||||
@@ -738,12 +738,12 @@ namespace BDInfo
|
||||
}
|
||||
}
|
||||
|
||||
foreach (TSStream clipStream
|
||||
foreach (var clipStream
|
||||
in referenceClip.StreamClipFile.Streams.Values)
|
||||
{
|
||||
if (!Streams.ContainsKey(clipStream.PID))
|
||||
{
|
||||
TSStream stream = clipStream.Clone();
|
||||
var stream = clipStream.Clone();
|
||||
Streams[clipStream.PID] = stream;
|
||||
|
||||
if (!IsCustom && !PlaylistStreams.ContainsKey(stream.PID))
|
||||
@@ -779,7 +779,7 @@ namespace BDInfo
|
||||
referenceClip.StreamFile.Streams.ContainsKey(4114) &&
|
||||
!Streams.ContainsKey(4114))
|
||||
{
|
||||
TSStream stream = referenceClip.StreamFile.Streams[4114].Clone();
|
||||
var stream = referenceClip.StreamFile.Streams[4114].Clone();
|
||||
Streams[4114] = stream;
|
||||
if (stream.IsVideoStream)
|
||||
{
|
||||
@@ -787,12 +787,12 @@ namespace BDInfo
|
||||
}
|
||||
}
|
||||
|
||||
foreach (TSStream clipStream
|
||||
foreach (var clipStream
|
||||
in referenceClip.StreamFile.Streams.Values)
|
||||
{
|
||||
if (Streams.ContainsKey(clipStream.PID))
|
||||
{
|
||||
TSStream stream = Streams[clipStream.PID];
|
||||
var stream = Streams[clipStream.PID];
|
||||
|
||||
if (stream.StreamType != clipStream.StreamType) continue;
|
||||
|
||||
@@ -811,8 +811,8 @@ namespace BDInfo
|
||||
else if (stream.IsAudioStream &&
|
||||
clipStream.IsAudioStream)
|
||||
{
|
||||
TSAudioStream audioStream = (TSAudioStream)stream;
|
||||
TSAudioStream clipAudioStream = (TSAudioStream)clipStream;
|
||||
var audioStream = (TSAudioStream)stream;
|
||||
var clipAudioStream = (TSAudioStream)clipStream;
|
||||
|
||||
if (clipAudioStream.ChannelCount > audioStream.ChannelCount)
|
||||
{
|
||||
@@ -863,7 +863,7 @@ namespace BDInfo
|
||||
SortedStreams.Add(stream);
|
||||
for (int i = 0; i < AngleCount; i++)
|
||||
{
|
||||
TSStream angleStream = stream.Clone();
|
||||
var angleStream = stream.Clone();
|
||||
angleStream.AngleIndex = i + 1;
|
||||
AngleStreams[i][angleStream.PID] = angleStream;
|
||||
SortedStreams.Add(angleStream);
|
||||
@@ -900,7 +900,7 @@ namespace BDInfo
|
||||
|
||||
public void ClearBitrates()
|
||||
{
|
||||
foreach (TSStreamClip clip in StreamClips)
|
||||
foreach (var clip in StreamClips)
|
||||
{
|
||||
clip.PayloadBytes = 0;
|
||||
clip.PacketCount = 0;
|
||||
@@ -908,7 +908,7 @@ namespace BDInfo
|
||||
|
||||
if (clip.StreamFile != null)
|
||||
{
|
||||
foreach (TSStream stream in clip.StreamFile.Streams.Values)
|
||||
foreach (var stream in clip.StreamFile.Streams.Values)
|
||||
{
|
||||
stream.PayloadBytes = 0;
|
||||
stream.PacketCount = 0;
|
||||
@@ -923,7 +923,7 @@ namespace BDInfo
|
||||
}
|
||||
}
|
||||
|
||||
foreach (TSStream stream in SortedStreams)
|
||||
foreach (var stream in SortedStreams)
|
||||
{
|
||||
stream.PayloadBytes = 0;
|
||||
stream.PacketCount = 0;
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace BDInfo
|
||||
|
||||
public TSDescriptor Clone()
|
||||
{
|
||||
TSDescriptor descriptor =
|
||||
var descriptor =
|
||||
new TSDescriptor(Name, (byte)Value.Length);
|
||||
Value.CopyTo(descriptor.Value, 0);
|
||||
return descriptor;
|
||||
@@ -404,7 +404,7 @@ namespace BDInfo
|
||||
if (Descriptors != null)
|
||||
{
|
||||
stream.Descriptors = new List<TSDescriptor>();
|
||||
foreach (TSDescriptor descriptor in Descriptors)
|
||||
foreach (var descriptor in Descriptors)
|
||||
{
|
||||
stream.Descriptors.Add(descriptor.Clone());
|
||||
}
|
||||
@@ -553,7 +553,7 @@ namespace BDInfo
|
||||
|
||||
public override TSStream Clone()
|
||||
{
|
||||
TSVideoStream stream = new TSVideoStream();
|
||||
var stream = new TSVideoStream();
|
||||
CopyTo(stream);
|
||||
|
||||
stream.VideoFormat = _VideoFormat;
|
||||
@@ -727,7 +727,7 @@ namespace BDInfo
|
||||
|
||||
public override TSStream Clone()
|
||||
{
|
||||
TSAudioStream stream = new TSAudioStream();
|
||||
var stream = new TSAudioStream();
|
||||
CopyTo(stream);
|
||||
|
||||
stream.SampleRate = SampleRate;
|
||||
@@ -756,7 +756,7 @@ namespace BDInfo
|
||||
|
||||
public override TSStream Clone()
|
||||
{
|
||||
TSGraphicsStream stream = new TSGraphicsStream();
|
||||
var stream = new TSGraphicsStream();
|
||||
CopyTo(stream);
|
||||
return stream;
|
||||
}
|
||||
@@ -772,7 +772,7 @@ namespace BDInfo
|
||||
|
||||
public override TSStream Clone()
|
||||
{
|
||||
TSTextStream stream = new TSTextStream();
|
||||
var stream = new TSTextStream();
|
||||
CopyTo(stream);
|
||||
return stream;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace BDInfo
|
||||
data += (Stream.ReadByte() << shift);
|
||||
shift -= 8;
|
||||
}
|
||||
BitVector32 vector = new BitVector32(data);
|
||||
var vector = new BitVector32(data);
|
||||
|
||||
int value = 0;
|
||||
for (int i = SkipBits; i < SkipBits + bits; i++)
|
||||
|
||||
@@ -90,11 +90,11 @@ namespace BDInfo
|
||||
|
||||
public bool IsCompatible(TSStreamClip clip)
|
||||
{
|
||||
foreach (TSStream stream1 in StreamFile.Streams.Values)
|
||||
foreach (var stream1 in StreamFile.Streams.Values)
|
||||
{
|
||||
if (clip.StreamFile.Streams.ContainsKey(stream1.PID))
|
||||
{
|
||||
TSStream stream2 = clip.StreamFile.Streams[stream1.PID];
|
||||
var stream2 = clip.StreamFile.Streams[stream1.PID];
|
||||
if (stream1.StreamType != stream2.StreamType)
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace BDInfo
|
||||
|
||||
streamOffset += 2;
|
||||
|
||||
TSStreamType streamType = (TSStreamType)
|
||||
var streamType = (TSStreamType)
|
||||
clipData[streamOffset + 1];
|
||||
switch (streamType)
|
||||
{
|
||||
@@ -127,11 +127,11 @@ namespace BDInfo
|
||||
case TSStreamType.MPEG2_VIDEO:
|
||||
case TSStreamType.VC1_VIDEO:
|
||||
{
|
||||
TSVideoFormat videoFormat = (TSVideoFormat)
|
||||
var videoFormat = (TSVideoFormat)
|
||||
(clipData[streamOffset + 2] >> 4);
|
||||
TSFrameRate frameRate = (TSFrameRate)
|
||||
var frameRate = (TSFrameRate)
|
||||
(clipData[streamOffset + 2] & 0xF);
|
||||
TSAspectRatio aspectRatio = (TSAspectRatio)
|
||||
var aspectRatio = (TSAspectRatio)
|
||||
(clipData[streamOffset + 3] >> 4);
|
||||
|
||||
stream = new TSVideoStream();
|
||||
@@ -168,9 +168,9 @@ namespace BDInfo
|
||||
string languageCode =
|
||||
_textEncoding.GetASCIIEncoding().GetString(languageBytes, 0, languageBytes.Length);
|
||||
|
||||
TSChannelLayout channelLayout = (TSChannelLayout)
|
||||
var channelLayout = (TSChannelLayout)
|
||||
(clipData[streamOffset + 2] >> 4);
|
||||
TSSampleRate sampleRate = (TSSampleRate)
|
||||
var sampleRate = (TSSampleRate)
|
||||
(clipData[streamOffset + 2] & 0xF);
|
||||
|
||||
stream = new TSAudioStream();
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace BDInfo
|
||||
|
||||
bool isAVC = false;
|
||||
bool isMVC = false;
|
||||
foreach (TSStream finishedStream in Streams.Values)
|
||||
foreach (var finishedStream in Streams.Values)
|
||||
{
|
||||
if (!finishedStream.IsInitialized)
|
||||
{
|
||||
@@ -327,10 +327,10 @@ namespace BDInfo
|
||||
UpdateStreamBitrate(PID, PTSPID, PTS, PTSDiff);
|
||||
}
|
||||
|
||||
foreach (TSPlaylistFile playlist in Playlists)
|
||||
foreach (var playlist in Playlists)
|
||||
{
|
||||
double packetSeconds = 0;
|
||||
foreach (TSStreamClip clip in playlist.StreamClips)
|
||||
foreach (var clip in playlist.StreamClips)
|
||||
{
|
||||
if (clip.AngleIndex == 0)
|
||||
{
|
||||
@@ -339,7 +339,7 @@ namespace BDInfo
|
||||
}
|
||||
if (packetSeconds > 0)
|
||||
{
|
||||
foreach (TSStream playlistStream in playlist.SortedStreams)
|
||||
foreach (var playlistStream in playlist.SortedStreams)
|
||||
{
|
||||
if (playlistStream.IsVBR)
|
||||
{
|
||||
@@ -366,14 +366,14 @@ namespace BDInfo
|
||||
{
|
||||
if (Playlists == null) return;
|
||||
|
||||
TSStreamState streamState = StreamStates[PID];
|
||||
var streamState = StreamStates[PID];
|
||||
double streamTime = (double)PTS / 90000;
|
||||
double streamInterval = (double)PTSDiff / 90000;
|
||||
double streamOffset = streamTime + streamInterval;
|
||||
|
||||
foreach (TSPlaylistFile playlist in Playlists)
|
||||
foreach (var playlist in Playlists)
|
||||
{
|
||||
foreach (TSStreamClip clip in playlist.StreamClips)
|
||||
foreach (var clip in playlist.StreamClips)
|
||||
{
|
||||
if (clip.Name != this.Name) continue;
|
||||
|
||||
@@ -390,7 +390,7 @@ namespace BDInfo
|
||||
clip.PacketSeconds = streamOffset - clip.TimeIn;
|
||||
}
|
||||
|
||||
Dictionary<ushort, TSStream> playlistStreams = playlist.Streams;
|
||||
var playlistStreams = playlist.Streams;
|
||||
if (clip.AngleIndex > 0 &&
|
||||
clip.AngleIndex < playlist.AngleStreams.Count + 1)
|
||||
{
|
||||
@@ -398,7 +398,7 @@ namespace BDInfo
|
||||
}
|
||||
if (playlistStreams.ContainsKey(PID))
|
||||
{
|
||||
TSStream stream = playlistStreams[PID];
|
||||
var stream = playlistStreams[PID];
|
||||
|
||||
stream.PayloadBytes += streamState.WindowBytes;
|
||||
stream.PacketCount += streamState.WindowPackets;
|
||||
@@ -425,13 +425,13 @@ namespace BDInfo
|
||||
|
||||
if (Streams.ContainsKey(PID))
|
||||
{
|
||||
TSStream stream = Streams[PID];
|
||||
var stream = Streams[PID];
|
||||
stream.PayloadBytes += streamState.WindowBytes;
|
||||
stream.PacketCount += streamState.WindowPackets;
|
||||
|
||||
if (stream.IsVideoStream)
|
||||
{
|
||||
TSStreamDiagnostics diag = new TSStreamDiagnostics();
|
||||
var diag = new TSStreamDiagnostics();
|
||||
diag.Marker = (double)PTS / 90000;
|
||||
diag.Interval = (double)PTSDiff / 90000;
|
||||
diag.Bytes = streamState.WindowBytes;
|
||||
@@ -482,7 +482,7 @@ namespace BDInfo
|
||||
StreamStates.Clear();
|
||||
StreamDiagnostics.Clear();
|
||||
|
||||
TSPacketParser parser =
|
||||
var parser =
|
||||
new TSPacketParser();
|
||||
|
||||
long fileLength = (uint)fileStream.Length;
|
||||
@@ -839,7 +839,7 @@ namespace BDInfo
|
||||
|
||||
if (!Streams.ContainsKey(streamPID))
|
||||
{
|
||||
List<TSDescriptor> streamDescriptors =
|
||||
var streamDescriptors =
|
||||
new List<TSDescriptor>();
|
||||
|
||||
/*
|
||||
@@ -996,7 +996,7 @@ namespace BDInfo
|
||||
{
|
||||
--parser.PMTProgramDescriptorLength;
|
||||
|
||||
TSDescriptor descriptor = parser.PMTProgramDescriptors[
|
||||
var descriptor = parser.PMTProgramDescriptors[
|
||||
parser.PMTProgramDescriptors.Count - 1];
|
||||
|
||||
int valueIndex =
|
||||
@@ -1026,8 +1026,8 @@ namespace BDInfo
|
||||
parser.StreamState != null &&
|
||||
parser.TransportScramblingControl == 0)
|
||||
{
|
||||
TSStream stream = parser.Stream;
|
||||
TSStreamState streamState = parser.StreamState;
|
||||
var stream = parser.Stream;
|
||||
var streamState = parser.StreamState;
|
||||
|
||||
streamState.Parse =
|
||||
(streamState.Parse << 8) + buffer[i];
|
||||
@@ -1461,7 +1461,7 @@ namespace BDInfo
|
||||
|
||||
ulong PTSLast = 0;
|
||||
ulong PTSDiff = 0;
|
||||
foreach (TSStream stream in Streams.Values)
|
||||
foreach (var stream in Streams.Values)
|
||||
{
|
||||
if (!stream.IsVideoStream) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user