WebAudio task shouldn't be running on suspend to reduce usage of CPU.
[framework/web/webkit-efl.git] / Source / WebCore / Modules / webaudio / AudioBufferSourceNode.cpp
index 5903020..d37807c 100644 (file)
@@ -69,9 +69,9 @@ AudioBufferSourceNode::AudioBufferSourceNode(AudioContext* context, float sample
 {
     setNodeType(NodeTypeAudioBufferSource);
 
-    m_gain = AudioGain::create(context, "gain", 1.0, 0.0, 1.0);
+    m_gain = AudioParam::create(context, "gain", 1.0, 0.0, 1.0);
     m_playbackRate = AudioParam::create(context, "playbackRate", 1.0, 0.0, MaxRate);
-    
+
     // Default to mono.  A call to setBuffer() will set the number of output channels to that of the buffer.
     addOutput(adoptPtr(new AudioNodeOutput(this, 1)));
 
@@ -433,6 +433,9 @@ void AudioBufferSourceNode::startGrain(double when, double grainOffset, double g
     m_virtualReadIndex = AudioUtilities::timeToSampleFrame(m_grainOffset, buffer()->sampleRate());
     
     m_playbackState = SCHEDULED_STATE;
+#if ENABLE(TIZEN_WEB_AUDIO)
+    context()->destination()->startRendering();
+#endif
 }
 
 #if ENABLE(TIZEN_WEB_AUDIO)