mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
kodi: add PR8334
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
fdf779a64c
commit
870a543196
102
packages/mediacenter/kodi/patches/kodi-999.23-PR8334.patch
Normal file
102
packages/mediacenter/kodi/patches/kodi-999.23-PR8334.patch
Normal file
@ -0,0 +1,102 @@
|
||||
From 792b25cf0cbec5a72df50d10c66ee8429bdc3fee Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Saraev <stefan@saraev.ca>
|
||||
Date: Sun, 1 Nov 2015 22:19:13 +0200
|
||||
Subject: [PATCH 1/3] [udevprovider] fix segfaults. mountpoint can be null
|
||||
|
||||
---
|
||||
xbmc/storage/linux/UDevProvider.cpp | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xbmc/storage/linux/UDevProvider.cpp b/xbmc/storage/linux/UDevProvider.cpp
|
||||
index 0ca370b..4aa7c5c 100644
|
||||
--- a/xbmc/storage/linux/UDevProvider.cpp
|
||||
+++ b/xbmc/storage/linux/UDevProvider.cpp
|
||||
@@ -254,7 +254,7 @@ bool CUDevProvider::PumpDriveChangeEvents(IStorageEventsCallback *callback)
|
||||
else if (mountpoint)
|
||||
label = URIUtils::GetFileName(mountpoint);
|
||||
|
||||
- if (!strcmp(action, "add") && !strcmp(devtype, "partition"))
|
||||
+ if (mountpoint && (!strcmp(action, "add") && !strcmp(devtype, "partition")))
|
||||
{
|
||||
CLog::Log(LOGNOTICE, "UDev: Added %s", mountpoint);
|
||||
if (callback)
|
||||
@@ -263,7 +263,6 @@ bool CUDevProvider::PumpDriveChangeEvents(IStorageEventsCallback *callback)
|
||||
}
|
||||
if (!strcmp(action, "remove") && !strcmp(devtype, "partition"))
|
||||
{
|
||||
- CLog::Log(LOGNOTICE, "UDev: Removed %s", mountpoint);
|
||||
if (callback)
|
||||
callback->OnStorageSafelyRemoved(label);
|
||||
changed = true;
|
||||
|
||||
From 775145e4165adcc7e0ca0f380fcbb1457425fa45 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Saraev <stefan@saraev.ca>
|
||||
Date: Sun, 1 Nov 2015 22:27:44 +0200
|
||||
Subject: [PATCH 2/3] [udevprovider] fix mounting raw filesystems on a non
|
||||
partitioned disks
|
||||
|
||||
---
|
||||
xbmc/storage/linux/UDevProvider.cpp | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/xbmc/storage/linux/UDevProvider.cpp b/xbmc/storage/linux/UDevProvider.cpp
|
||||
index 4aa7c5c..ff1681c 100644
|
||||
--- a/xbmc/storage/linux/UDevProvider.cpp
|
||||
+++ b/xbmc/storage/linux/UDevProvider.cpp
|
||||
@@ -254,14 +254,15 @@ bool CUDevProvider::PumpDriveChangeEvents(IStorageEventsCallback *callback)
|
||||
else if (mountpoint)
|
||||
label = URIUtils::GetFileName(mountpoint);
|
||||
|
||||
- if (mountpoint && (!strcmp(action, "add") && !strcmp(devtype, "partition")))
|
||||
+ const char *fs_usage = udev_device_get_property_value(dev, "ID_FS_USAGE");
|
||||
+ if (mountpoint && strcmp(action, "add") == 0 && (fs_usage && strcmp(fs_usage, "filesystem") == 0))
|
||||
{
|
||||
CLog::Log(LOGNOTICE, "UDev: Added %s", mountpoint);
|
||||
if (callback)
|
||||
callback->OnStorageAdded(label, mountpoint);
|
||||
changed = true;
|
||||
}
|
||||
- if (!strcmp(action, "remove") && !strcmp(devtype, "partition"))
|
||||
+ if (strcmp(action, "remove") == 0 && (fs_usage && strcmp(fs_usage, "filesystem") == 0))
|
||||
{
|
||||
if (callback)
|
||||
callback->OnStorageSafelyRemoved(label);
|
||||
|
||||
From 1290d25920c42e0e01360a7b6c3be9043bf73ad6 Mon Sep 17 00:00:00 2001
|
||||
From: Stefan Saraev <stefan@saraev.ca>
|
||||
Date: Mon, 2 Nov 2015 13:13:02 +0200
|
||||
Subject: [PATCH 3/3] [udevprovider] also handle 'change' events. fixes data
|
||||
cd/dvds
|
||||
|
||||
---
|
||||
xbmc/storage/linux/UDevProvider.cpp | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
diff --git a/xbmc/storage/linux/UDevProvider.cpp b/xbmc/storage/linux/UDevProvider.cpp
|
||||
index ff1681c..63a154c 100644
|
||||
--- a/xbmc/storage/linux/UDevProvider.cpp
|
||||
+++ b/xbmc/storage/linux/UDevProvider.cpp
|
||||
@@ -268,6 +268,23 @@ bool CUDevProvider::PumpDriveChangeEvents(IStorageEventsCallback *callback)
|
||||
callback->OnStorageSafelyRemoved(label);
|
||||
changed = true;
|
||||
}
|
||||
+ if (strcmp(action, "change") == 0)
|
||||
+ {
|
||||
+ if (mountpoint)
|
||||
+ {
|
||||
+ CLog::Log(LOGNOTICE, "UDev: Changed / Added %s", mountpoint);
|
||||
+ if (callback)
|
||||
+ callback->OnStorageAdded(label, mountpoint);
|
||||
+ changed = true;
|
||||
+ }
|
||||
+ const char *eject_request = udev_device_get_property_value(dev, "DISK_EJECT_REQUEST");
|
||||
+ if (eject_request && strcmp(eject_request, "1") == 0)
|
||||
+ {
|
||||
+ if (callback)
|
||||
+ callback->OnStorageSafelyRemoved(label);
|
||||
+ changed = true;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
udev_device_unref(dev);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user