mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-26 12:16:20 +00:00
Merge pull request #37 from JosJuice/dvd-thread-safety
DVDThread: Fix thread safety
This commit is contained in:
commit
4b0e7a2e99
1 changed files with 7 additions and 4 deletions
|
@ -396,16 +396,19 @@ static void DVDThread()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReadFile(std::string& fileName, std::vector<u8>& buf) {
|
void ReadFile(std::string& fileName, std::vector<u8>& buf)
|
||||||
if (HasDisc()) {
|
{
|
||||||
|
if (HasDisc())
|
||||||
|
{
|
||||||
|
WaitUntilIdle();
|
||||||
const DiscIO::FileSystem* filesystem = s_disc->GetFileSystem(DiscIO::PARTITION_NONE);
|
const DiscIO::FileSystem* filesystem = s_disc->GetFileSystem(DiscIO::PARTITION_NONE);
|
||||||
auto fileInfo = filesystem->FindFileInfo(fileName);
|
auto fileInfo = filesystem->FindFileInfo(fileName);
|
||||||
auto fileSize = fileInfo->GetSize();
|
auto fileSize = fileInfo->GetSize();
|
||||||
WaitUntilIdle();
|
|
||||||
buf.resize(fileSize);
|
buf.resize(fileSize);
|
||||||
DiscIO::ReadFile(*s_disc, DiscIO::PARTITION_NONE, fileInfo.get(), buf.data(), fileSize);
|
DiscIO::ReadFile(*s_disc, DiscIO::PARTITION_NONE, fileInfo.get(), buf.data(), fileSize);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
INFO_LOG(SLIPPI, "Failed to open file: %s", fileName.c_str());
|
INFO_LOG(SLIPPI, "Failed to open file: %s", fileName.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue