aboutsummaryrefslogtreecommitdiff
path: root/DvdLib
diff options
context:
space:
mode:
Diffstat (limited to 'DvdLib')
-rw-r--r--DvdLib/BigEndianBinaryReader.cs5
-rw-r--r--DvdLib/DvdLib.csproj6
-rw-r--r--DvdLib/Ifo/AudioAttributes.cs5
-rw-r--r--DvdLib/Ifo/Cell.cs4
-rw-r--r--DvdLib/Ifo/CellPlaybackInfo.cs4
-rw-r--r--DvdLib/Ifo/CellPositionInfo.cs4
-rw-r--r--DvdLib/Ifo/Chapter.cs5
-rw-r--r--DvdLib/Ifo/Dvd.cs23
-rw-r--r--DvdLib/Ifo/DvdTime.cs7
-rw-r--r--DvdLib/Ifo/PgcCommandTable.cs3
-rw-r--r--DvdLib/Ifo/Program.cs3
-rw-r--r--DvdLib/Ifo/ProgramChain.cs12
-rw-r--r--DvdLib/Ifo/Title.cs7
-rw-r--r--DvdLib/Ifo/UserOperation.cs5
-rw-r--r--DvdLib/Ifo/VideoAttributes.cs5
-rw-r--r--DvdLib/Properties/AssemblyInfo.cs26
16 files changed, 35 insertions, 89 deletions
diff --git a/DvdLib/BigEndianBinaryReader.cs b/DvdLib/BigEndianBinaryReader.cs
index 56d9db825..b3b2eabd5 100644
--- a/DvdLib/BigEndianBinaryReader.cs
+++ b/DvdLib/BigEndianBinaryReader.cs
@@ -1,7 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System;
using System.IO;
namespace DvdLib
diff --git a/DvdLib/DvdLib.csproj b/DvdLib/DvdLib.csproj
index 403ecec4e..b2c752d0c 100644
--- a/DvdLib/DvdLib.csproj
+++ b/DvdLib/DvdLib.csproj
@@ -1,4 +1,8 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <ItemGroup>
+ <Compile Include="..\SharedVersion.cs" />
+ </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
diff --git a/DvdLib/Ifo/AudioAttributes.cs b/DvdLib/Ifo/AudioAttributes.cs
index 5b3b9fd9a..b76f9fc05 100644
--- a/DvdLib/Ifo/AudioAttributes.cs
+++ b/DvdLib/Ifo/AudioAttributes.cs
@@ -1,8 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
namespace DvdLib.Ifo
{
public enum AudioCodec
diff --git a/DvdLib/Ifo/Cell.cs b/DvdLib/Ifo/Cell.cs
index d0f442e36..268ab897e 100644
--- a/DvdLib/Ifo/Cell.cs
+++ b/DvdLib/Ifo/Cell.cs
@@ -1,7 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.IO;
namespace DvdLib.Ifo
diff --git a/DvdLib/Ifo/CellPlaybackInfo.cs b/DvdLib/Ifo/CellPlaybackInfo.cs
index ae3883eaa..e588e51ac 100644
--- a/DvdLib/Ifo/CellPlaybackInfo.cs
+++ b/DvdLib/Ifo/CellPlaybackInfo.cs
@@ -1,7 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.IO;
namespace DvdLib.Ifo
diff --git a/DvdLib/Ifo/CellPositionInfo.cs b/DvdLib/Ifo/CellPositionInfo.cs
index 2e0715940..2b973e083 100644
--- a/DvdLib/Ifo/CellPositionInfo.cs
+++ b/DvdLib/Ifo/CellPositionInfo.cs
@@ -1,7 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.IO;
namespace DvdLib.Ifo
diff --git a/DvdLib/Ifo/Chapter.cs b/DvdLib/Ifo/Chapter.cs
index 802c6ce62..bd3bd9704 100644
--- a/DvdLib/Ifo/Chapter.cs
+++ b/DvdLib/Ifo/Chapter.cs
@@ -1,8 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
namespace DvdLib.Ifo
{
public class Chapter
diff --git a/DvdLib/Ifo/Dvd.cs b/DvdLib/Ifo/Dvd.cs
index 508c23db4..f784be83e 100644
--- a/DvdLib/Ifo/Dvd.cs
+++ b/DvdLib/Ifo/Dvd.cs
@@ -1,9 +1,7 @@
-using System;
+using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.IO;
-using System.Diagnostics;
+using System.Linq;
using MediaBrowser.Model.IO;
namespace DvdLib.Ifo
@@ -33,10 +31,9 @@ namespace DvdLib.Ifo
foreach (var ifo in allIfos)
{
var num = ifo.Name.Split('_').ElementAtOrDefault(1);
- ushort ifoNumber;
var numbersRead = new List<ushort>();
- if (!string.IsNullOrEmpty(num) && ushort.TryParse(num, out ifoNumber) && !numbersRead.Contains(ifoNumber))
+ if (!string.IsNullOrEmpty(num) && ushort.TryParse(num, out var ifoNumber) && !numbersRead.Contains(ifoNumber))
{
ReadVTS(ifoNumber, ifo.FullName);
numbersRead.Add(ifoNumber);
@@ -47,7 +44,7 @@ namespace DvdLib.Ifo
{
using (var vmgFs = _fileSystem.GetFileStream(vmgPath.FullName, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read))
{
- using (BigEndianBinaryReader vmgRead = new BigEndianBinaryReader(vmgFs))
+ using (var vmgRead = new BigEndianBinaryReader(vmgFs))
{
vmgFs.Seek(0x3E, SeekOrigin.Begin);
_titleSetCount = vmgRead.ReadUInt16();
@@ -73,7 +70,7 @@ namespace DvdLib.Ifo
read.BaseStream.Seek(6, SeekOrigin.Current);
for (uint titleNum = 1; titleNum <= _titleCount; titleNum++)
{
- Title t = new Title(titleNum);
+ var t = new Title(titleNum);
t.ParseTT_SRPT(read);
Titles.Add(t);
}
@@ -81,7 +78,7 @@ namespace DvdLib.Ifo
private void ReadVTS(ushort vtsNum, List<FileSystemMetadata> allFiles)
{
- var filename = String.Format("VTS_{0:00}_0.IFO", vtsNum);
+ var filename = string.Format("VTS_{0:00}_0.IFO", vtsNum);
var vtsPath = allFiles.FirstOrDefault(i => string.Equals(i.Name, filename, StringComparison.OrdinalIgnoreCase)) ??
allFiles.FirstOrDefault(i => string.Equals(i.Name, Path.ChangeExtension(filename, ".bup"), StringComparison.OrdinalIgnoreCase));
@@ -100,7 +97,7 @@ namespace DvdLib.Ifo
using (var vtsFs = _fileSystem.GetFileStream(vtsPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.Read))
{
- using (BigEndianBinaryReader vtsRead = new BigEndianBinaryReader(vtsFs))
+ using (var vtsRead = new BigEndianBinaryReader(vtsFs))
{
// Read VTS_PTT_SRPT
vtsFs.Seek(0xC8, SeekOrigin.Begin);
@@ -121,7 +118,7 @@ namespace DvdLib.Ifo
{
uint chapNum = 1;
vtsFs.Seek(baseAddr + offsets[titleNum], SeekOrigin.Begin);
- Title t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum + 1));
+ var t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum + 1));
if (t == null) continue;
do
@@ -151,11 +148,11 @@ namespace DvdLib.Ifo
vtsFs.Seek(3, SeekOrigin.Current);
uint vtsPgcOffset = vtsRead.ReadUInt32();
- Title t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum));
+ var t = Titles.FirstOrDefault(vtst => vtst.IsVTSTitle(vtsNum, titleNum));
if (t != null) t.AddPgc(vtsRead, startByte + vtsPgcOffset, entryPgc, pgcNum);
}
}
}
}
}
-} \ No newline at end of file
+}
diff --git a/DvdLib/Ifo/DvdTime.cs b/DvdLib/Ifo/DvdTime.cs
index f565f5fdf..3688089ec 100644
--- a/DvdLib/Ifo/DvdTime.cs
+++ b/DvdLib/Ifo/DvdTime.cs
@@ -1,7 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System;
namespace DvdLib.Ifo
{
@@ -20,7 +17,7 @@ namespace DvdLib.Ifo
else if ((data[3] & 0x40) != 0) FrameRate = 25;
}
- private byte GetBCDValue(byte data)
+ private static byte GetBCDValue(byte data)
{
return (byte)((((data & 0xF0) >> 4) * 10) + (data & 0x0F));
}
diff --git a/DvdLib/Ifo/PgcCommandTable.cs b/DvdLib/Ifo/PgcCommandTable.cs
index 2ead78cef..d329fcba2 100644
--- a/DvdLib/Ifo/PgcCommandTable.cs
+++ b/DvdLib/Ifo/PgcCommandTable.cs
@@ -1,7 +1,4 @@
-using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
namespace DvdLib.Ifo
{
diff --git a/DvdLib/Ifo/Program.cs b/DvdLib/Ifo/Program.cs
index 48870d9dd..af08afa35 100644
--- a/DvdLib/Ifo/Program.cs
+++ b/DvdLib/Ifo/Program.cs
@@ -1,7 +1,4 @@
-using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
namespace DvdLib.Ifo
{
diff --git a/DvdLib/Ifo/ProgramChain.cs b/DvdLib/Ifo/ProgramChain.cs
index 6b4e5fa32..80889738f 100644
--- a/DvdLib/Ifo/ProgramChain.cs
+++ b/DvdLib/Ifo/ProgramChain.cs
@@ -1,8 +1,6 @@
-using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.IO;
+using System.Linq;
namespace DvdLib.Ifo
{
@@ -68,7 +66,7 @@ namespace DvdLib.Ifo
ProhibitedUserOperations = (UserOperation)br.ReadUInt32();
AudioStreamControl = br.ReadBytes(16);
SubpictureStreamControl = br.ReadBytes(128);
-
+
_nextProgramNumber = br.ReadUInt16();
_prevProgramNumber = br.ReadUInt16();
_goupProgramNumber = br.ReadUInt16();
@@ -89,7 +87,7 @@ namespace DvdLib.Ifo
br.BaseStream.Seek(startPos + _cellPositionOffset, SeekOrigin.Begin);
for (int cellNum = 0; cellNum < _cellCount; cellNum++)
{
- Cell c = new Cell();
+ var c = new Cell();
c.ParsePosition(br);
Cells.Add(c);
}
@@ -101,12 +99,12 @@ namespace DvdLib.Ifo
}
br.BaseStream.Seek(startPos + _programMapOffset, SeekOrigin.Begin);
- List<int> cellNumbers = new List<int>();
+ var cellNumbers = new List<int>();
for (int progNum = 0; progNum < _programCount; progNum++) cellNumbers.Add(br.ReadByte() - 1);
for (int i = 0; i < cellNumbers.Count; i++)
{
- int max = (i + 1 == cellNumbers.Count) ? _cellCount : cellNumbers[i+1];
+ int max = (i + 1 == cellNumbers.Count) ? _cellCount : cellNumbers[i + 1];
Programs.Add(new Program(Cells.Where((c, idx) => idx >= cellNumbers[i] && idx < max).ToList()));
}
}
diff --git a/DvdLib/Ifo/Title.cs b/DvdLib/Ifo/Title.cs
index 70deb45bf..335e92992 100644
--- a/DvdLib/Ifo/Title.cs
+++ b/DvdLib/Ifo/Title.cs
@@ -1,7 +1,4 @@
-using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.IO;
namespace DvdLib.Ifo
@@ -20,7 +17,7 @@ namespace DvdLib.Ifo
public ProgramChain EntryProgramChain { get; private set; }
public readonly List<ProgramChain> ProgramChains;
- public readonly List<Chapter> Chapters;
+ public readonly List<Chapter> Chapters;
public Title(uint titleNum)
{
@@ -53,7 +50,7 @@ namespace DvdLib.Ifo
long curPos = br.BaseStream.Position;
br.BaseStream.Seek(startByte, SeekOrigin.Begin);
- ProgramChain pgc = new ProgramChain(pgcNum);
+ var pgc = new ProgramChain(pgcNum);
pgc.ParseHeader(br);
ProgramChains.Add(pgc);
if (entryPgc) EntryProgramChain = pgc;
diff --git a/DvdLib/Ifo/UserOperation.cs b/DvdLib/Ifo/UserOperation.cs
index c3cffd487..757a5a05d 100644
--- a/DvdLib/Ifo/UserOperation.cs
+++ b/DvdLib/Ifo/UserOperation.cs
@@ -1,7 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+using System;
namespace DvdLib.Ifo
{
diff --git a/DvdLib/Ifo/VideoAttributes.cs b/DvdLib/Ifo/VideoAttributes.cs
index b2d375942..8b3996715 100644
--- a/DvdLib/Ifo/VideoAttributes.cs
+++ b/DvdLib/Ifo/VideoAttributes.cs
@@ -1,8 +1,3 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-
namespace DvdLib.Ifo
{
public enum VideoCodec
diff --git a/DvdLib/Properties/AssemblyInfo.cs b/DvdLib/Properties/AssemblyInfo.cs
index cca792684..5fc055d1f 100644
--- a/DvdLib/Properties/AssemblyInfo.cs
+++ b/DvdLib/Properties/AssemblyInfo.cs
@@ -1,29 +1,21 @@
-using System.Resources;
using System.Reflection;
-using System.Runtime.CompilerServices;
+using System.Resources;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("DvdLib")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("DvdLib")]
-[assembly: AssemblyCopyright("Copyright © 2016")]
+[assembly: AssemblyCompany("Jellyfin Project")]
+[assembly: AssemblyProduct("Jellyfin: The Free Software Media System")]
+[assembly: AssemblyCopyright("Copyright © 2019 Jellyfin Contributors. Code released under the GNU General Public License Version 2")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en")]
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.1")] \ No newline at end of file
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]