ActiveAE: do reset timer of state machine on other events
authorRainer Hochecker <fernetmenta@online.de>
Tue, 5 Nov 2013 17:20:37 +0000 (18:20 +0100)
committerRainer Hochecker <fernetmenta@online.de>
Tue, 5 Nov 2013 17:20:37 +0000 (18:20 +0100)
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp

index 8c9b572..fa2328f 100644 (file)
@@ -712,6 +712,7 @@ void CActiveAE::Process()
   Message *msg = NULL;
   Protocol *port = NULL;
   bool gotMsg;
+  XbmcThreads::EndTime timer;
 
   m_state = AE_TOP_UNCONFIGURED;
   m_extTimeout = 1000;
@@ -725,6 +726,7 @@ void CActiveAE::Process()
   while (!m_bStop)
   {
     gotMsg = false;
+    timer.Set(m_extTimeout);
 
     if (m_bStateMachineSelfTrigger)
     {
@@ -788,6 +790,7 @@ void CActiveAE::Process()
     // wait for message
     else if (m_outMsgEvent.WaitMSec(m_extTimeout))
     {
+      m_extTimeout = timer.MillisLeft();
       continue;
     }
     // time out
index d2a8d12..d175e7d 100644 (file)
@@ -462,6 +462,7 @@ void CActiveAESink::Process()
   Message *msg = NULL;
   Protocol *port = NULL;
   bool gotMsg;
+  XbmcThreads::EndTime timer;
 
   m_state = S_TOP_UNCONFIGURED;
   m_extTimeout = 1000;
@@ -470,6 +471,7 @@ void CActiveAESink::Process()
   while (!m_bStop)
   {
     gotMsg = false;
+    timer.Set(m_extTimeout);
 
     if (m_bStateMachineSelfTrigger)
     {
@@ -510,6 +512,7 @@ void CActiveAESink::Process()
     // wait for message
     else if (m_outMsgEvent.WaitMSec(m_extTimeout))
     {
+      m_extTimeout = timer.MillisLeft();
       continue;
     }
     // time out