Revert "Shiny Drum Machine doesn't play in TRATS device."
authorPraveen Jadhav <praveen.j@samsung.com>
Wed, 26 Jun 2013 11:50:49 +0000 (11:50 +0000)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 27 Jun 2013 08:37:09 +0000 (08:37 +0000)
[Issue]: WEB-3340
[Problem]: Audio playback is delayed for 5 sec if ConvolverNode takes longer time to process audio
[Solution]: Revert this patch to play the audio continuously without any break

This reverts commit 921475cf76b500b4730f9b4f3e76a96da45a154a

Change-Id: Ief8e8458b25a3e9f04fffcde27710af423438e0f

Source/WebCore/Modules/webaudio/ConvolverNode.cpp
Source/WebCore/Modules/webaudio/ConvolverNode.h

index 2c95424..c8010d0 100644 (file)
@@ -33,9 +33,6 @@
 #include "AudioNodeInput.h"
 #include "AudioNodeOutput.h"
 #include "Reverb.h"
-#if ENABLE(TIZEN_WEB_AUDIO)
-#include <wtf/CurrentTime.h>
-#endif
 #include <wtf/MainThread.h>
 
 // Note about empirical tuning:
@@ -51,10 +48,6 @@ namespace WebCore {
 ConvolverNode::ConvolverNode(AudioContext* context, float sampleRate)
     : AudioNode(context, sampleRate)
     , m_normalize(true)
-#if ENABLE(TIZEN_WEB_AUDIO)
-    , m_latencyTime(0.0)
-    , m_resetCount(0)
-#endif
 {
     addInput(adoptPtr(new AudioNodeInput(this)));
     addOutput(adoptPtr(new AudioNodeOutput(this, 2)));
@@ -74,22 +67,6 @@ void ConvolverNode::process(size_t framesToProcess)
     AudioBus* outputBus = output(0)->bus();
     ASSERT(outputBus);
 
-#if ENABLE(TIZEN_WEB_AUDIO)
-    if (m_resetCount > 5 * sampleRate()) {
-        // Wait for 5 sec before checking again.
-        m_resetCount = 0;
-        m_latencyTime = 0.0;
-    }
-
-    if (m_latencyTime > framesToProcess / sampleRate()) {
-        m_resetCount += framesToProcess;
-        outputBus->zero();
-        return;
-    }
-
-    double currentTime = WTF::currentTime();
-#endif
-
     // Synchronize with possible dynamic changes to the impulse response.
     MutexTryLocker tryLocker(m_processLock);
     if (tryLocker.locked()) {
@@ -106,10 +83,6 @@ void ConvolverNode::process(size_t framesToProcess)
         // Too bad - the tryLock() failed.  We must be in the middle of setting a new impulse response.
         outputBus->zero();
     }
-
-#if ENABLE(TIZEN_WEB_AUDIO)
-    m_latencyTime = WTF::currentTime() - currentTime;
-#endif
 }
 
 void ConvolverNode::reset()
index 6465686..6d58918 100644 (file)
@@ -71,10 +71,6 @@ private:
 
     // Normalize the impulse response or not. Must default to true.
     bool m_normalize;
-#if ENABLE(TIZEN_WEB_AUDIO)
-    double m_latencyTime;
-    unsigned m_resetCount;
-#endif
 };
 
 } // namespace WebCore