mirror of
https://github.com/aaru-dps/Aaru.VideoNow.git
synced 2025-12-16 19:24:36 +00:00
Check for start of frame header marking before reading complete frame marker.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ContentModelStore">
|
<component name="ContentModelStore">
|
||||||
|
<e p="$APPLICATION_CONFIG_DIR$/consoles/db" t="IncludeRecursive" />
|
||||||
<e p="$APPLICATION_CONFIG_DIR$/extensions" t="IncludeRecursive" />
|
<e p="$APPLICATION_CONFIG_DIR$/extensions" t="IncludeRecursive" />
|
||||||
<e p="$USER_HOME$/.Rider2018.3/system/extResources" t="IncludeRecursive" />
|
<e p="$USER_HOME$/.Rider2018.3/system/extResources" t="IncludeRecursive" />
|
||||||
<e p="$USER_HOME$/.Rider2018.3/system/resharper-host/local/Transient/ReSharperHost/v183/SolutionCaches/_DiscImageChef.VideoNow.-333220507.00" t="ExcludeRecursive" />
|
<e p="$USER_HOME$/.Rider2018.3/system/resharper-host/local/Transient/ReSharperHost/v183/SolutionCaches/_DiscImageChef.VideoNow.-333220507.00" t="ExcludeRecursive" />
|
||||||
|
|||||||
@@ -48,6 +48,16 @@ namespace DiscImageChef.VideoNow
|
|||||||
static string assemblyTitle;
|
static string assemblyTitle;
|
||||||
static AssemblyInformationalVersionAttribute assemblyVersion;
|
static AssemblyInformationalVersionAttribute assemblyVersion;
|
||||||
|
|
||||||
|
static readonly byte[] FrameStart =
|
||||||
|
{
|
||||||
|
0xE3, 0x81, 0xC7, 0xE3, 0x81, 0xC7, 0xE3, 0x81
|
||||||
|
};
|
||||||
|
|
||||||
|
static readonly byte[] SwappedFrameStart =
|
||||||
|
{
|
||||||
|
0x81, 0xE3, 0xE3, 0xC7, 0xC7, 0x81, 0x81, 0xE3
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is some kind of header. Every 10 bytes there's an audio byte. Here it is without reordering from little
|
/// This is some kind of header. Every 10 bytes there's an audio byte. Here it is without reordering from little
|
||||||
/// endian, so the first appearence is at 9th byte.
|
/// endian, so the first appearence is at 9th byte.
|
||||||
@@ -161,9 +171,21 @@ namespace DiscImageChef.VideoNow
|
|||||||
byte[] buffer = new byte[FrameMarker.Length];
|
byte[] buffer = new byte[FrameMarker.Length];
|
||||||
byte[] swappedBuffer = new byte[FrameMarker.Length];
|
byte[] swappedBuffer = new byte[FrameMarker.Length];
|
||||||
bool swapped = false;
|
bool swapped = false;
|
||||||
|
byte[] startBuffer = new byte[FrameStart.Length];
|
||||||
|
|
||||||
while(framePosition < 19600)
|
while(framePosition < 19600)
|
||||||
{
|
{
|
||||||
|
fs.Position = framePosition;
|
||||||
|
fs.Read(startBuffer, 0, startBuffer.Length);
|
||||||
|
|
||||||
|
if(!startBuffer.SequenceEqual(FrameStart) &&
|
||||||
|
!startBuffer.SequenceEqual(SwappedFrameStart))
|
||||||
|
{
|
||||||
|
framePosition++;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
fs.Position = framePosition;
|
fs.Position = framePosition;
|
||||||
fs.Read(buffer, 0, buffer.Length);
|
fs.Read(buffer, 0, buffer.Length);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user