- fixed FileSystemSoundFontReader fail to read gus patches.

The method open_file use read text flags to open a file and it fail to check the header of the gus patches, by setting the flag to read binary fix the issue.
This commit is contained in:
Emanuele Disco 2022-04-09 03:30:31 +09:00 committed by Christoph Oelckers
parent f4cfb36f4a
commit a3b79ca8f6

View file

@ -320,7 +320,7 @@ public:
std::string fullname;
if (!fn)
{
f = utf8_fopen(mBaseFile.c_str(), "rt");
f = utf8_fopen(mBaseFile.c_str(), "rb");
fullname = mBaseFile;
}
else
@ -330,11 +330,11 @@ public:
for(int i = (int)mPaths.size()-1; i>=0; i--)
{
fullname = mPaths[i] + fn;
f = utf8_fopen(fullname.c_str(), "rt");
break;
f = utf8_fopen(fullname.c_str(), "rb");
if (f) break;
}
}
if (!f) f = fopen(fn, "rt");
if (!f) f = fopen(fn, "rb");
}
if (!f) return nullptr;
auto tf = new StdioFileReader;