зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 04751f3545ad (bug 1264199)
This commit is contained in:
Родитель
a7abcccd64
Коммит
e53741644d
|
@ -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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче