aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Arrskog <topfs2@xbmc.org>2014-11-24 19:51:31 +0100
committerTobias Arrskog <topfs2@xbmc.org>2014-11-24 19:51:31 +0100
commit216fbe1f75163614e0823a58836f761f3d746115 (patch)
treecb0f4749a8e474f1468e04b01c544dfaa1ad701b
parent5fcce61bc3958a92722513e5810e28bed2833580 (diff)
parentd7df798ecb33e9b265314dee84eec1e524931695 (diff)
Merge pull request #5786 from ksooo/fix-cec-adpater-app-exitcode-handling
[cec] Fixed PeripheralCecAdapter application exit code handling.
-rw-r--r--xbmc/Application.cpp3
-rw-r--r--xbmc/interfaces/json-rpc/schema/notifications.json6
-rw-r--r--xbmc/interfaces/json-rpc/schema/version.txt2
-rw-r--r--xbmc/peripherals/devices/PeripheralCecAdapter.cpp4
4 files changed, 10 insertions, 5 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index e0d40c9911..875ca391d6 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -3481,7 +3481,8 @@ void CApplication::Stop(int exitCode)
{
try
{
- CVariant vExitCode(exitCode);
+ CVariant vExitCode(CVariant::VariantTypeObject);
+ vExitCode["exitcode"] = exitCode;
CAnnouncementManager::Get().Announce(System, "xbmc", "OnQuit", vExitCode);
SaveFileState(true);
diff --git a/xbmc/interfaces/json-rpc/schema/notifications.json b/xbmc/interfaces/json-rpc/schema/notifications.json
index 262781179f..77d7311e7c 100644
--- a/xbmc/interfaces/json-rpc/schema/notifications.json
+++ b/xbmc/interfaces/json-rpc/schema/notifications.json
@@ -248,7 +248,11 @@
"description": "XBMC will be closed.",
"params": [
{ "name": "sender", "type": "string", "required": true },
- { "name": "data", "type": "null", "required": true }
+ { "name": "data", "type": "object", "required": true,
+ "properties": {
+ "exitcode": { "type": "integer", "minimum": 0, "required": true }
+ }
+ }
],
"returns": null
},
diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt
index 00825aa90a..7ecad14053 100644
--- a/xbmc/interfaces/json-rpc/schema/version.txt
+++ b/xbmc/interfaces/json-rpc/schema/version.txt
@@ -1 +1 @@
-6.20.1
+6.21.0
diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
index 1a8fd5949f..e80feb16bb 100644
--- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
+++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp
@@ -126,7 +126,7 @@ void CPeripheralCecAdapter::ResetMembers(void)
m_strMenuLanguage = "???";
m_lastKeypress = 0;
m_lastChange = VOLUME_CHANGE_NONE;
- m_iExitCode = 0;
+ m_iExitCode = EXITCODE_QUIT;
m_bIsMuted = false; // TODO fetch the correct initial value when system audiostatus is implemented in libCEC
m_bGoingToStandby = false;
m_bIsRunning = false;
@@ -149,7 +149,7 @@ void CPeripheralCecAdapter::Announce(AnnouncementFlag flag, const char *sender,
if (flag == System && !strcmp(sender, "xbmc") && !strcmp(message, "OnQuit") && m_bIsReady)
{
CSingleLock lock(m_critSection);
- m_iExitCode = (int)data["shuttingdown"].asInteger(0);
+ m_iExitCode = static_cast<int>(data["exitcode"].asInteger(EXITCODE_QUIT));
CAnnouncementManager::Get().RemoveAnnouncer(this);
StopThread(false);
}