diff options
author | Miguel Borges de Freitas <enen92@users.noreply.github.com> | 2022-12-15 14:57:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-15 14:57:13 +0000 |
commit | bd5467637ecdc57292fc38534a4cc9ce570fa5e9 (patch) | |
tree | 54cf77b6b7735cde507ed56ca78357e3968107a8 | |
parent | 86fd0f522fe37600e0548b963e1bafae39f6075b (diff) | |
parent | 2f9356a918aee77e80c5ca8f43cc1cd265801498 (diff) |
Merge pull request #22268 from enen92/nexus_backport_fix_discs_macos
[Discs] Fix physical drive access on macOS
-rw-r--r-- | xbmc/platform/posix/storage/discs/DiscDriveHandlerPosix.cpp | 1 | ||||
-rw-r--r-- | xbmc/storage/cdioSupport.cpp | 4 | ||||
-rw-r--r-- | xbmc/storage/cdioSupport.h | 4 |
3 files changed, 8 insertions, 1 deletions
diff --git a/xbmc/platform/posix/storage/discs/DiscDriveHandlerPosix.cpp b/xbmc/platform/posix/storage/discs/DiscDriveHandlerPosix.cpp index 2bd50ead37..1ef288a3bc 100644 --- a/xbmc/platform/posix/storage/discs/DiscDriveHandlerPosix.cpp +++ b/xbmc/platform/posix/storage/discs/DiscDriveHandlerPosix.cpp @@ -45,6 +45,7 @@ DriveState CDiscDriveHandlerPosix::GetDriveState(const std::string& devicePath) switch (status) { case CdioTrayStatus::CLOSED: + case CdioTrayStatus::UNKNOWN: driveStatus = DriveState::CLOSED_MEDIA_UNDEFINED; break; diff --git a/xbmc/storage/cdioSupport.cpp b/xbmc/storage/cdioSupport.cpp index 2cc28081d1..70e2463077 100644 --- a/xbmc/storage/cdioSupport.cpp +++ b/xbmc/storage/cdioSupport.cpp @@ -25,6 +25,8 @@ namespace constexpr int CDIO_TRAY_STATUS_CLOSED = 0; /* Helper constexpr to hide the 1 return code for tray open */ constexpr int CDIO_TRAY_STATUS_OPEN = 1; +/* Helper constexpr to hide the -2 driver code for unsupported tray status get operation */ +constexpr int CDIO_TRAY_STATUS_OP_UNSUPPORTED = -2; } // namespace using namespace MEDIA_DETECT; @@ -154,6 +156,8 @@ CdioTrayStatus CLibcdio::mmc_get_tray_status(const CdIo_t* p_cdio) return CdioTrayStatus::CLOSED; case CDIO_TRAY_STATUS_OPEN: return CdioTrayStatus::OPEN; + case CDIO_TRAY_STATUS_OP_UNSUPPORTED: + return CdioTrayStatus::UNKNOWN; default: break; } diff --git a/xbmc/storage/cdioSupport.h b/xbmc/storage/cdioSupport.h index 0d55dc14fa..b786ff2d3f 100644 --- a/xbmc/storage/cdioSupport.h +++ b/xbmc/storage/cdioSupport.h @@ -105,7 +105,9 @@ enum class CdioTrayStatus CLOSED, /* The MMC tray state is reported open */ OPEN, - /* Driver error */ + /* The MMC tray status operation is not supported */ + UNKNOWN, + /* Generic driver error */ DRIVER_ERROR }; |