diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2010-12-03 12:42:01 +0000 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2010-12-03 12:42:01 +0000 |
| commit | 3d441febda6a22a6e35168f5f5f4218275cf8295 (patch) | |
| tree | 1e181d6738bc9897fcd17d85ab51c4154f0eaa5d /Source/Core/DiscIO/Src/CompressedBlob.cpp | |
| parent | 08a3b60f8c52a88de31070e1cb4f8e5dadab47e8 (diff) | |
Attempt to fix issue r3458. I don't have a 32bit linux install, however I know it will at least fix compressing. Please test if uncompressed games run.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6510 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DiscIO/Src/CompressedBlob.cpp')
| -rw-r--r-- | Source/Core/DiscIO/Src/CompressedBlob.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Source/Core/DiscIO/Src/CompressedBlob.cpp b/Source/Core/DiscIO/Src/CompressedBlob.cpp index e822d45e6c..9d0daa74f7 100644 --- a/Source/Core/DiscIO/Src/CompressedBlob.cpp +++ b/Source/Core/DiscIO/Src/CompressedBlob.cpp @@ -39,9 +39,7 @@ CompressedBlobReader::CompressedBlobReader(const char *filename) { file_name = filename; file = fopen(filename, "rb"); - fseek(file, 0, SEEK_END); - file_size = ftell(file); - fseek(file, 0, SEEK_SET); + file_size = File::GetSize(filename); fread(&header, sizeof(CompressedBlobHeader), 1, file); SetSectorSize(header.block_size); @@ -190,14 +188,11 @@ bool CompressFileToBlob(const char* infile, const char* outfile, u32 sub_type, callback("Files opened, ready to compress.", 0, arg); - fseek(inf, 0, SEEK_END); - s64 insize = ftell(inf); - fseek(inf, 0, SEEK_SET); CompressedBlobHeader header; header.magic_cookie = kBlobCookie; header.sub_type = sub_type; header.block_size = block_size; - header.data_size = insize; + header.data_size = File::GetSize(infile); // round upwards! header.num_blocks = (u32)((header.data_size + (block_size - 1)) / block_size); |
