PKGBUILDs/community/xbmc/0004-CEC-fixed-don-t-return-garbage-from-CEC-related-app-.patch

113 lines
3.5 KiB
Diff
Raw Normal View History

2014-11-06 13:22:36 +00:00
From 6544830d1a0b9810c2feb2fcb34df3f90b010d2f Mon Sep 17 00:00:00 2001
From: Lars Op den Kamp <lars@opdenkamp.eu>
Date: Mon, 27 Oct 2014 21:01:00 +0100
Subject: [PATCH 4/8] [CEC] fixed: don't return garbage from CEC related app
messenger methods see
https://github.com/xbmc/xbmc/commit/19d37944ca2a2ac2f3e71a40a94e9ea289d8f2db#commitcomment-8248480
---
xbmc/Application.cpp | 14 ++++++++------
xbmc/ApplicationMessenger.cpp | 20 +++++---------------
xbmc/ApplicationMessenger.h | 4 ++--
3 files changed, 15 insertions(+), 23 deletions(-)
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp
index d5604dc..4d26183 100644
--- a/xbmc/Application.cpp
+++ b/xbmc/Application.cpp
@@ -2351,16 +2351,18 @@
if (StringUtils::StartsWithNoCase(action.GetName(),"CECToggleState") || StringUtils::StartsWithNoCase(action.GetName(),"CECStandby"))
{
- bool ret = true;
-
- CLog::Log(LOGDEBUG, "%s: action %s [%d], toggling state of playing device", __FUNCTION__, action.GetName().c_str(), action.GetID());
// do not wake up the screensaver right after switching off the playing device
if (StringUtils::StartsWithNoCase(action.GetName(),"CECToggleState"))
- ret = CApplicationMessenger::Get().CECToggleState();
+ {
+ CLog::Log(LOGDEBUG, "%s: action %s [%d], toggling state of playing device", __FUNCTION__, action.GetName().c_str(), action.GetID());
+ if (!CApplicationMessenger::Get().CECToggleState())
+ return true;
+ }
else
- ret = CApplicationMessenger::Get().CECStandby();
- if (!ret) /* display is switched off */
+ {
+ CApplicationMessenger::Get().CECStandby();
return true;
+ }
}
ResetScreenSaver();
diff --git a/xbmc/ApplicationMessenger.cpp b/xbmc/ApplicationMessenger.cpp
index 1a59c5c..d228273 100644
--- a/xbmc/ApplicationMessenger.cpp
+++ b/xbmc/ApplicationMessenger.cpp
@@ -843,12 +843,12 @@ void CApplicationMessenger::ProcessMessage(ThreadMessage *pMsg)
}
case TMSG_CECACTIVATESOURCE:
{
- *((bool*)pMsg->lpVoid) = g_peripherals.ToggleDeviceState(STATE_ACTIVATE_SOURCE);
+ g_peripherals.ToggleDeviceState(STATE_ACTIVATE_SOURCE);
break;
}
case TMSG_CECSTANDBY:
{
- *((bool*)pMsg->lpVoid) = g_peripherals.ToggleDeviceState(STATE_STANDBY);
+ g_peripherals.ToggleDeviceState(STATE_STANDBY);
break;
}
case TMSG_START_ANDROID_ACTIVITY:
@@ -1396,29 +1396,19 @@ bool CApplicationMessenger::CECToggleState()
ThreadMessage tMsg = {TMSG_CECTOGGLESTATE};
tMsg.lpVoid = (void*)&result;
- SendMessage(tMsg, false);
+ SendMessage(tMsg, true);
return result;
}
-bool CApplicationMessenger::CECActivateSource()
+void CApplicationMessenger::CECActivateSource()
{
- bool result;
-
ThreadMessage tMsg = {TMSG_CECACTIVATESOURCE};
- tMsg.lpVoid = (void*)&result;
SendMessage(tMsg, false);
-
- return result;
}
-bool CApplicationMessenger::CECStandby()
+void CApplicationMessenger::CECStandby()
{
- bool result;
-
ThreadMessage tMsg = {TMSG_CECSTANDBY};
- tMsg.lpVoid = (void*)&result;
SendMessage(tMsg, false);
-
- return result;
}
diff --git a/xbmc/ApplicationMessenger.h b/xbmc/ApplicationMessenger.h
index 9013567..543e065 100644
--- a/xbmc/ApplicationMessenger.h
+++ b/xbmc/ApplicationMessenger.h
@@ -219,8 +219,8 @@ public:
void LoadProfile(unsigned int idx);
bool CECToggleState();
- bool CECActivateSource();
- bool CECStandby();
+ void CECActivateSource();
+ void CECStandby();
CStdString GetResponse();
int SetResponse(CStdString response);
--
2.1.2