Merge pull request #1777 from JosJuice/filemonitor-volumedirectory

Add FileMonitor support for VolumeDirectory
This commit is contained in:
skidau 2015-01-20 12:32:42 +11:00
commit 6f61f90dab
2 changed files with 6 additions and 2 deletions

View File

@ -92,7 +92,7 @@ void ReadFileSystem(const std::string& filename)
FileAccess = true;
}
// Check if we should play this file
// Logs a file if it passes a few checks
void CheckFile(const std::string& file, u64 size)
{
// Don't do anything if the log is unselected

View File

@ -17,6 +17,7 @@
#include "Common/MathUtil.h"
#include "Core/VolumeHandler.h"
#include "DiscIO/FileBlob.h"
#include "DiscIO/FileMonitor.h"
#include "DiscIO/Volume.h"
#include "DiscIO/VolumeDirectory.h"
@ -125,13 +126,16 @@ bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer, bool decrypt
{
_dbg_assert_(DVDINTERFACE, fileIter->first <= _Offset);
u64 fileOffset = _Offset - fileIter->first;
const std::string fileName = fileIter->second;
std::unique_ptr<PlainFileReader> reader(PlainFileReader::Create(fileIter->second));
std::unique_ptr<PlainFileReader> reader(PlainFileReader::Create(fileName));
if (reader == nullptr)
return false;
u64 fileSize = reader->GetDataSize();
FileMon::CheckFile(fileName, fileSize);
if (fileOffset < fileSize)
{
u64 fileBytes = fileSize - fileOffset;