Backed out changeset 04751f3545ad (bug 1264199)

This commit is contained in:
Carsten "Tomcat" Book 2016-04-18 14:22:05 +02:00
Родитель a7abcccd64
Коммит e53741644d
2 изменённых файлов: 2 добавлений и 19 удалений

Просмотреть файл

@ -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; }

Просмотреть файл

@ -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;