mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 15:44:00 +08:00
convert OGV format into Ogg propery.
This commit is contained in:
parent
d7030ecbdc
commit
227eae0dbe
@ -25,6 +25,7 @@
|
||||
|
||||
using System.ComponentModel.Composition;
|
||||
using System.IO;
|
||||
using GameRes.Utility;
|
||||
|
||||
namespace GameRes.Formats.ShiinaRio
|
||||
{
|
||||
@ -37,21 +38,29 @@ namespace GameRes.Formats.ShiinaRio
|
||||
|
||||
public override SoundInput TryOpen (Stream file)
|
||||
{
|
||||
var input = file as MemoryStream;
|
||||
if (null == input || !input.CanWrite)
|
||||
file.Position = 0xc;
|
||||
var header = new byte[8];
|
||||
if (8 != file.Read (header, 0, 8))
|
||||
return null;
|
||||
if (!Binary.AsciiEqual (header, 0, "fmt "))
|
||||
return null;
|
||||
uint offset = LittleEndian.ToUInt32 (header, 4);
|
||||
file.Seek (offset, SeekOrigin.Current);
|
||||
if (8 != file.Read (header, 0, 8))
|
||||
return null;
|
||||
if (!Binary.AsciiEqual (header, 0, "data"))
|
||||
return null;
|
||||
|
||||
var input = new StreamRegion (file, file.Position);
|
||||
try
|
||||
{
|
||||
input = new MemoryStream();
|
||||
file.CopyTo (input);
|
||||
return new OggInput (input);
|
||||
}
|
||||
catch
|
||||
{
|
||||
input.Dispose();
|
||||
throw;
|
||||
}
|
||||
input.Position = 1;
|
||||
input.WriteByte ((byte)'g');
|
||||
input.WriteByte ((byte)'g');
|
||||
input.WriteByte ((byte)'S');
|
||||
input.Position = 0;
|
||||
var ogg = new OggInput (input);
|
||||
if (file != input)
|
||||
file.Dispose();
|
||||
return ogg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// 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.6.62")]
|
||||
[assembly: AssemblyFileVersion ("1.0.6.62")]
|
||||
[assembly: AssemblyVersion ("1.0.6.63")]
|
||||
[assembly: AssemblyFileVersion ("1.0.6.63")]
|
||||
|
Loading…
Reference in New Issue
Block a user