diff --git a/packages/mediacenter/xbmc/patches/xbmc-999.80.01-PR4592.patch b/packages/mediacenter/xbmc/patches/xbmc-999.80.01-PR4592.patch new file mode 100644 index 0000000000..ecc9edc561 --- /dev/null +++ b/packages/mediacenter/xbmc/patches/xbmc-999.80.01-PR4592.patch @@ -0,0 +1,62 @@ +From 6a926768eba981c6498f852fe26dfa6644da82ac Mon Sep 17 00:00:00 2001 +From: "Chris \"Koying\" Browet" +Date: Wed, 23 Apr 2014 16:33:19 +0200 +Subject: [PATCH] FIX: [linux] fix & optimize input device checking + +--- + xbmc/input/linux/LinuxInputDevices.cpp | 12 +++++++++++- + xbmc/input/linux/LinuxInputDevices.h | 1 + + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp +index 4b642ae..f11ec01 100644 +--- a/xbmc/input/linux/LinuxInputDevices.cpp ++++ b/xbmc/input/linux/LinuxInputDevices.cpp +@@ -936,6 +936,11 @@ char* CLinuxInputDevice::GetDeviceName() + return m_deviceName; + } + ++std::string CLinuxInputDevice::GetFileName() ++{ ++ return m_fileName; ++} ++ + bool CLinuxInputDevice::IsUnplugged() + { + return m_bUnplugged; +@@ -945,6 +950,11 @@ bool CLinuxInputDevices::CheckDevice(const char *device) + { + int fd; + ++ // Does the device exists? ++ struct stat buffer; ++ if (stat(device, &buffer) != 0) ++ return false; ++ + /* Check if we are able to open the device */ + fd = open(device, O_RDWR); + if (fd < 0) +@@ -1016,7 +1026,7 @@ void CLinuxInputDevices::CheckHotplugged() + + for (size_t j = 0; j < m_devices.size(); j++) + { +- if (strcmp(m_devices[j]->GetDeviceName(),buf) == 0) ++ if (m_devices[j]->GetFileName().compare(buf) == 0) + { + ispresent = true; + break; +diff --git a/xbmc/input/linux/LinuxInputDevices.h b/xbmc/input/linux/LinuxInputDevices.h +index c385ed7..a406d9c 100644 +--- a/xbmc/input/linux/LinuxInputDevices.h ++++ b/xbmc/input/linux/LinuxInputDevices.h +@@ -42,6 +42,7 @@ class CLinuxInputDevice + ~CLinuxInputDevice(); + XBMC_Event ReadEvent(); + char* GetDeviceName(); ++ std::string GetFileName(); + bool IsUnplugged(); + + private: +-- +1.9.1 +