[SCM] kodi-pvr-vdr-vnsi/master: fix addon settings prio and port
tiber-guest at users.alioth.debian.org
tiber-guest at users.alioth.debian.org
Fri Nov 4 00:20:26 UTC 2016
The following commit has been merged in the master branch:
commit 8ca049356cde5598a1551665e42005363f2c88d6
Author: Rainer Hochecker <fernetmenta at online.de>
Date: Thu Sep 22 11:06:16 2016 +0200
fix addon settings prio and port
diff --git a/pvr.vdr.vnsi/resources/settings.xml b/pvr.vdr.vnsi/resources/settings.xml
index 2f62fa3..1212d42 100644
--- a/pvr.vdr.vnsi/resources/settings.xml
+++ b/pvr.vdr.vnsi/resources/settings.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<setting id="host" type="text" label="30000" default="127.0.0.1" />
- <setting id="port" type="number" label="30001" default="34890" />
+ <setting id="port" type="number" option="int" label="30001" default="34890" />
<setting id="priority" type="enum" label="30002" values="0|5|10|15|20|25|30|35|40|45|50|55|60|65|70|75|80|85|90|95|99|100" default="0"/>
<setting id="timeshift" type="enum" label="30047" values="0|1" default="1"/>
<setting id="convertchar" type="bool" label="30003" default="true" />
diff --git a/src/client.cpp b/src/client.cpp
index a16c5f6..6544e00 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -37,7 +37,7 @@ using namespace std;
using namespace ADDON;
using namespace P8PLATFORM;
-ADDON_STATUS m_CurStatus = ADDON_STATUS_UNKNOWN;
+ADDON_STATUS m_CurStatus = ADDON_STATUS_UNKNOWN;
/* User adjustable settings are saved here.
* Default values are defined inside client.h
@@ -53,14 +53,16 @@ bool g_bAutoChannelGroups = DEFAULT_AUTOGROUPS;
int g_iTimeshift = 1;
std::string g_szIconPath = "";
-CHelper_libXBMC_addon *XBMC = NULL;
-CHelper_libXBMC_codec *CODEC = NULL;
-CHelper_libKODI_guilib *GUI = NULL;
-CHelper_libXBMC_pvr *PVR = NULL;
+int prioVals[] = {0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,99,100};
-cVNSIDemux *VNSIDemuxer = NULL;
-cVNSIData *VNSIData = NULL;
-cVNSIRecording *VNSIRecording = NULL;
+CHelper_libXBMC_addon *XBMC = nullptr;
+CHelper_libXBMC_codec *CODEC = nullptr;
+CHelper_libKODI_guilib *GUI = nullptr;
+CHelper_libXBMC_pvr *PVR = nullptr;
+
+cVNSIDemux *VNSIDemuxer = nullptr;
+cVNSIData *VNSIData = nullptr;
+cVNSIRecording *VNSIRecording = nullptr;
bool IsTimeshift;
time_t TimeshiftStartTime;
@@ -161,7 +163,6 @@ ADDON_STATUS ADDON_Create(void* hdl, void* props)
XBMC->Log(LOG_ERROR, "Couldn't get 'priority' setting, falling back to %i as default", -1);
prio = DEFAULT_PRIORITY;
}
- int prioVals[] = {-99,-1,0,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,99,100};
g_iPriority = prioVals[prio];
/* Read setting "timeshift" from settings.xml */
@@ -302,17 +303,18 @@ ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue)
}
else if (str == "port")
{
- XBMC->Log(LOG_INFO, "Changed Setting 'port' from %u to %u", g_iPort, *(int*) settingValue);
- if (g_iPort != *(int*) settingValue)
+ XBMC->Log(LOG_INFO, "Changed Setting 'port' from %u to %u", g_iPort, *(int*)settingValue);
+ if (g_iPort != *(int*)settingValue)
{
- g_iPort = *(int*) settingValue;
+ g_iPort = *(int*)settingValue;
return ADDON_STATUS_NEED_RESTART;
}
}
else if (str == "priority")
{
- XBMC->Log(LOG_INFO, "Changed Setting 'priority' from %u to %u", g_iPriority, *(int*) settingValue);
- g_iPriority = *(int*) settingValue;
+ int newPrio = prioVals[*(int*)settingValue];
+ XBMC->Log(LOG_INFO, "Changed Setting 'priority' from %u to %u", g_iPriority, newPrio);
+ g_iPriority = newPrio;
}
else if (str == "timeshift")
{
--
kodi-pvr-vdr-vnsi packaging
More information about the pkg-multimedia-commits
mailing list