From e53741644d08642c9c21eb566472c9434cb88adc Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Mon, 18 Apr 2016 14:22:05 +0200 Subject: [PATCH] Backed out changeset 04751f3545ad (bug 1264199) --- dom/media/AudioStream.h | 5 ----- dom/media/mediasink/DecodedAudioDataSink.cpp | 16 ++-------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/dom/media/AudioStream.h b/dom/media/AudioStream.h index 3143a87cab00..e105e6b1b954 100644 --- a/dom/media/AudioStream.h +++ b/dom/media/AudioStream.h @@ -286,11 +286,6 @@ public: // Returns true when the audio stream is paused. bool IsPaused(); - static uint32_t GetPreferredRate() - { - CubebUtils::InitPreferredSampleRate(); - return CubebUtils::PreferredSampleRate(); - } uint32_t GetRate() { return mOutRate; } uint32_t GetChannels() { return mChannels; } uint32_t GetOutChannels() { return mOutChannels; } diff --git a/dom/media/mediasink/DecodedAudioDataSink.cpp b/dom/media/mediasink/DecodedAudioDataSink.cpp index 7128c7fe6335..cedc35cdcb29 100644 --- a/dom/media/mediasink/DecodedAudioDataSink.cpp +++ b/dom/media/mediasink/DecodedAudioDataSink.cpp @@ -49,20 +49,8 @@ DecodedAudioDataSink::DecodedAudioDataSink(AbstractThread* aThread, , mLastEndTime(0) { bool resampling = gfxPrefs::AudioSinkResampling(); - - if (resampling) { - mOutputRate = gfxPrefs::AudioSinkResampleRate(); - } else if (mInfo.mRate == 44100 || mInfo.mRate == 48000) { - // The original rate is of good quality and we want to minimize unecessary - // resampling. The common scenario being that the sampling rate is one or - // the other, this allows to minimize audio quality regression and hoping - // content provider want change from those rates mid-stream. - mOutputRate = mInfo.mRate; - } else { - // We will resample all data to match cubeb's preferred sampling rate. - mOutputRate = AudioStream::GetPreferredRate(); - } - + uint32_t resamplingRate = gfxPrefs::AudioSinkResampleRate(); + mOutputRate = resampling ? resamplingRate : mInfo.mRate; mOutputChannels = mInfo.mChannels > 2 && gfxPrefs::AudioSinkForceStereo() ? 2 : mInfo.mChannels;