mirror of
https://github.com/aaru-dps/Aaru.VideoNow.git
synced 2025-12-16 19:24:36 +00:00
Analyze all frames.
This commit is contained in:
@@ -39,11 +39,14 @@ namespace DiscImageChef.VideoNow
|
|||||||
{
|
{
|
||||||
static class MainClass
|
static class MainClass
|
||||||
{
|
{
|
||||||
|
const int max_size = 635040000;
|
||||||
static string AssemblyCopyright;
|
static string AssemblyCopyright;
|
||||||
static string AssemblyTitle;
|
static string AssemblyTitle;
|
||||||
static AssemblyInformationalVersionAttribute AssemblyVersion;
|
static AssemblyInformationalVersionAttribute AssemblyVersion;
|
||||||
const int max_size = 635040000;
|
static readonly byte[] frameMarker =
|
||||||
static readonly byte[] frameMarker = { 0xE3, 0x81, 0xC7, 0xE3, 0x81, 0xC7, 0xE3, 0x81};
|
{
|
||||||
|
0xE3, 0x81, 0xC7, 0xE3, 0x81, 0xC7, 0xE3, 0x81
|
||||||
|
};
|
||||||
|
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
@@ -107,6 +110,74 @@ namespace DiscImageChef.VideoNow
|
|||||||
|
|
||||||
Console.WriteLine("First frame found at {0}", framePosition);
|
Console.WriteLine("First frame found at {0}", framePosition);
|
||||||
Console.WriteLine("First frame {0} at a sector boundary", framePosition % 2352 == 0 ? "is" : "is not");
|
Console.WriteLine("First frame {0} at a sector boundary", framePosition % 2352 == 0 ? "is" : "is not");
|
||||||
|
|
||||||
|
int totalFrames = 1;
|
||||||
|
char progress = ' ';
|
||||||
|
framePosition += 19600;
|
||||||
|
|
||||||
|
while(framePosition + 19600 < fs.Length)
|
||||||
|
{
|
||||||
|
switch(totalFrames % 4)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
progress = '-';
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
progress = '\\';
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
progress = '|';
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
progress = '/';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.Write("\rLooking for more frames {0}", progress);
|
||||||
|
|
||||||
|
if(!buffer.SequenceEqual(frameMarker))
|
||||||
|
{
|
||||||
|
Console.Write("\r \r");
|
||||||
|
Console.WriteLine("Frame {0} and the next one are not aligned...", totalFrames);
|
||||||
|
long expectedFramePosition = framePosition;
|
||||||
|
|
||||||
|
while(framePosition < fs.Length)
|
||||||
|
{
|
||||||
|
fs.Position = framePosition;
|
||||||
|
fs.Read(buffer, 0, buffer.Length);
|
||||||
|
|
||||||
|
if(buffer.SequenceEqual(frameMarker))
|
||||||
|
{
|
||||||
|
totalFrames++;
|
||||||
|
Console.WriteLine("Frame {1} found at {0}, {2} bytes apart", framePosition, totalFrames,
|
||||||
|
framePosition - expectedFramePosition);
|
||||||
|
Console.WriteLine("Frame {1} {0} at a sector boundary",
|
||||||
|
framePosition % 2352 == 0 ? "is" : "is not", totalFrames);
|
||||||
|
framePosition += 19600;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
framePosition++;
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(framePosition % 2352 == 0)
|
||||||
|
{
|
||||||
|
Console.Write("\r \r");
|
||||||
|
Console.WriteLine("Frame {0} is at a sector boundary", totalFrames);
|
||||||
|
}
|
||||||
|
|
||||||
|
totalFrames++;
|
||||||
|
fs.Position = framePosition;
|
||||||
|
fs.Read(buffer, 0, buffer.Length);
|
||||||
|
framePosition += 19600;
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.Write("\r \r");
|
||||||
|
Console.WriteLine("Found {0} frames", totalFrames);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PrintCopyright()
|
static void PrintCopyright()
|
||||||
@@ -115,6 +186,5 @@ namespace DiscImageChef.VideoNow
|
|||||||
Console.WriteLine("{0}", AssemblyCopyright);
|
Console.WriteLine("{0}", AssemblyCopyright);
|
||||||
Console.WriteLine();
|
Console.WriteLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user