mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 11:45:45 -04:00
CDImageDevice: Implement disc reading for Linux
And fix it for Windows. SubQ reading should now work.
This commit is contained in:
@ -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)
|
||||
|
@ -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
Reference in New Issue
Block a user