CDImageDevice: Implement disc reading for Linux

And fix it for Windows. SubQ reading should now work.
This commit is contained in:
Stenzek
2024-03-01 00:50:31 +10:00
parent b060edc61b
commit 9e26622a12
6 changed files with 803 additions and 165 deletions

View File

@ -276,6 +276,10 @@ elseif(NOT ANDROID)
pkg_check_modules(DBUS REQUIRED dbus-1)
target_include_directories(util PRIVATE ${DBUS_INCLUDE_DIRS})
target_link_libraries(util PRIVATE ${DBUS_LINK_LIBRARIES})
if(LINUX)
target_link_libraries(util PRIVATE UDEV::UDEV)
endif()
endif()
if(NOT WIN32 AND NOT ANDROID)

View File

@ -61,14 +61,21 @@ std::unique_ptr<CDImage> CDImage::Open(const char* filename, bool allow_patches,
extension = std::strrchr(filename, '.');
#endif
std::unique_ptr<CDImage> image;
if (!extension)
{
Log_ErrorPrintf("Invalid filename: '%s'", filename);
return nullptr;
// Device filenames on Linux don't have extensions.
if (IsDeviceName(filename))
{
image = OpenDeviceImage(filename, error);
}
else
{
Log_ErrorPrintf("Invalid filename: '%s'", filename);
return nullptr;
}
}
std::unique_ptr<CDImage> image;
if (StringUtil::Strcasecmp(extension, ".cue") == 0)
else if (StringUtil::Strcasecmp(extension, ".cue") == 0)
{
image = OpenCueSheetImage(filename, error);
}

File diff suppressed because it is too large Load Diff