ActiveAE: always stream low noise in PCM idle mode, keeps AVRs alive, credits @fritsch
authorRainer Hochecker <fernetmenta@online.de>
Sat, 31 Aug 2013 09:29:42 +0000 (11:29 +0200)
committerRainer Hochecker <fernetmenta@online.de>
Sat, 31 Aug 2013 11:32:51 +0000 (13:32 +0200)
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp
xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.h

index 834e938..7362bcf 100644 (file)
@@ -102,7 +102,6 @@ enum SINK_STATES
   S_TOP_CONFIGURED_IDLE,          // 4
   S_TOP_CONFIGURED_PLAY,          // 5
   S_TOP_CONFIGURED_SILENCE,       // 6
-  S_TOP_CONFIGURED_WARMUP,        // 7
 };
 
 int SINK_parentStates[] = {
@@ -113,7 +112,6 @@ int SINK_parentStates[] = {
     2, //TOP_CONFIGURED_IDLE
     2, //TOP_CONFIGURED_PLAY
     2, //TOP_CONFIGURED_SILENCE
-    2, //TOP_CONFIGURED_WARMUP
 };
 
 void CActiveAESink::StateMachine(int signal, Protocol *port, Message *msg)
@@ -245,8 +243,7 @@ void CActiveAESink::StateMachine(int signal, Protocol *port, Message *msg)
             m_extSilence = true;
           if (m_extSilence)
           {
-            m_extCycleCounter = 5;
-            m_state = S_TOP_CONFIGURED_WARMUP;
+            m_state = S_TOP_CONFIGURED_SILENCE;
             m_extTimeout = 0;
           }
           return;
@@ -402,36 +399,7 @@ void CActiveAESink::StateMachine(int signal, Protocol *port, Message *msg)
         switch (signal)
         {
         case CSinkControlProtocol::TIMEOUT:
-          OutputSamples(&m_sampleOfSilence);
-          m_extCycleCounter--;
-          if (m_extError)
-          {
-            m_sink->Deinitialize();
-            delete m_sink;
-            m_sink = NULL;
-            m_state = S_TOP_CONFIGURED_SUSPEND;
-          }
-          else if(m_extCycleCounter <= 0)
-          {
-            m_extCycleCounter = 2;
-            m_state = S_TOP_CONFIGURED_WARMUP;
-          }
-          m_extTimeout = 0;
-          return;
-        default:
-          break;
-        }
-      }
-      break;
-
-    case S_TOP_CONFIGURED_WARMUP:
-      if (port == NULL) // timeout
-      {
-        switch (signal)
-        {
-        case CSinkControlProtocol::TIMEOUT:
           OutputSamples(&m_sampleOfNoise);
-          m_extCycleCounter--;
           if (m_extError)
           {
             m_sink->Deinitialize();
@@ -439,11 +407,6 @@ void CActiveAESink::StateMachine(int signal, Protocol *port, Message *msg)
             m_sink = NULL;
             m_state = S_TOP_CONFIGURED_SUSPEND;
           }
-          else if(m_extCycleCounter <= 0)
-          {
-            m_extCycleCounter = 20;
-            m_state = S_TOP_CONFIGURED_SILENCE;
-          }
           m_extTimeout = 0;
           return;
         default:
index ee35021..937c6c7 100644 (file)
@@ -115,7 +115,6 @@ protected:
   int m_extTimeout;
   bool m_extError;
   bool m_extSilence;
-  int m_extCycleCounter;
 
   CSampleBuffer m_sampleOfSilence;
   CSampleBuffer m_sampleOfNoise;