From 494bca7d4f677b017702ae32189a9a10c0c5becc Mon Sep 17 00:00:00 2001 From: JW Wang Date: Tue, 28 Jul 2015 20:21:26 +0800 Subject: [PATCH] Bug 1187817. Part 2 - remove unused code. r=kinetik. --- dom/media/AudioSink.cpp | 43 ----------------------------------------- dom/media/AudioSink.h | 10 ---------- 2 files changed, 53 deletions(-) diff --git a/dom/media/AudioSink.cpp b/dom/media/AudioSink.cpp index 814366adebf1..47acb6062f17 100644 --- a/dom/media/AudioSink.cpp +++ b/dom/media/AudioSink.cpp @@ -36,13 +36,7 @@ AudioSink::AudioSink(MediaQueue& aAudioQueue, , mLastGoodPosition(0) , mInfo(aInfo) , mChannel(aChannel) - , mVolume(1.0) - , mPlaybackRate(1.0) - , mPreservesPitch(false) , mStopAudioThread(false) - , mSetVolume(false) - , mSetPlaybackRate(false) - , mSetPreservesPitch(false) , mPlaying(true) { } @@ -226,7 +220,6 @@ AudioSink::InitializeAudioStream() ReentrantMonitorAutoEnter mon(GetReentrantMonitor()); mAudioStream = audioStream; - UpdateStreamSettings(); return NS_OK; } @@ -290,8 +283,6 @@ AudioSink::IsPlaybackContinuing() return false; } - UpdateStreamSettings(); - return true; } @@ -449,40 +440,6 @@ AudioSink::PlayFromAudioQueue() return audio->mFrames; } -void -AudioSink::UpdateStreamSettings() -{ - AssertCurrentThreadInMonitor(); - - bool setVolume = mSetVolume; - bool setPlaybackRate = mSetPlaybackRate; - bool setPreservesPitch = mSetPreservesPitch; - double volume = mVolume; - double playbackRate = mPlaybackRate; - bool preservesPitch = mPreservesPitch; - - mSetVolume = false; - mSetPlaybackRate = false; - mSetPreservesPitch = false; - - { - ReentrantMonitorAutoExit exit(GetReentrantMonitor()); - if (setVolume) { - mAudioStream->SetVolume(volume); - } - - if (setPlaybackRate && - NS_FAILED(mAudioStream->SetPlaybackRate(playbackRate))) { - NS_WARNING("Setting the playback rate failed in AudioSink."); - } - - if (setPreservesPitch && - NS_FAILED(mAudioStream->SetPreservesPitch(preservesPitch))) { - NS_WARNING("Setting the pitch preservation failed in AudioSink."); - } - } -} - void AudioSink::StartAudioStreamPlaybackIfNeeded() { diff --git a/dom/media/AudioSink.h b/dom/media/AudioSink.h index 7dcb76068ee9..cfea21e8c07c 100644 --- a/dom/media/AudioSink.h +++ b/dom/media/AudioSink.h @@ -114,8 +114,6 @@ private: // audio data to the audio hardware. Called on the audio thread. uint32_t PlayFromAudioQueue(); - void UpdateStreamSettings(); - // If we have already written enough frames to the AudioStream, start the // playback. void StartAudioStreamPlaybackIfNeeded(); @@ -172,16 +170,8 @@ private: dom::AudioChannel mChannel; - double mVolume; - double mPlaybackRate; - bool mPreservesPitch; - bool mStopAudioThread; - bool mSetVolume; - bool mSetPlaybackRate; - bool mSetPreservesPitch; - bool mPlaying; MozPromiseHolder mEndPromise;