mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
Only open file once when detecting blob type
This commit is contained in:
parent
3fdcbbdd92
commit
d1ea00ed88
9 changed files with 40 additions and 61 deletions
|
@ -28,6 +28,8 @@
|
|||
|
||||
namespace DiscIO
|
||||
{
|
||||
bool IsGCZBlob(const std::string& filename);
|
||||
|
||||
CompressedBlobReader::CompressedBlobReader(const std::string& filename) : m_file_name(filename)
|
||||
{
|
||||
m_file.Open(filename, "rb");
|
||||
|
@ -192,7 +194,7 @@ bool CompressFileToBlob(const std::string& infile, const std::string& outfile, u
|
|||
callback(GetStringT("Files opened, ready to compress."), 0, arg);
|
||||
|
||||
CompressedBlobHeader header;
|
||||
header.magic_cookie = kBlobCookie;
|
||||
header.magic_cookie = GCZ_MAGIC;
|
||||
header.sub_type = sub_type;
|
||||
header.block_size = block_size;
|
||||
header.data_size = File::GetSize(infile);
|
||||
|
@ -401,7 +403,7 @@ bool IsGCZBlob(const std::string& filename)
|
|||
File::IOFile f(filename, "rb");
|
||||
|
||||
CompressedBlobHeader header;
|
||||
return f.ReadArray(&header, 1) && (header.magic_cookie == kBlobCookie);
|
||||
return f.ReadArray(&header, 1) && (header.magic_cookie == GCZ_MAGIC);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue