Bug 1332905 - For mono or stereo in AudioStream.cpp until the rest of the code is multichannel-aware. r=achronop a=tomcat

MozReview-Commit-ID: 5eqBlPnHVk2
This commit is contained in:
Paul Adenot 2017-01-23 11:36:58 +01:00
Родитель e12cc94275
Коммит f012888dd8
2 изменённых файлов: 5 добавлений и 8 удалений

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

@ -354,10 +354,9 @@ AudioStream::Init(uint32_t aNumChannels, uint32_t aRate,
return NS_ERROR_DOM_MEDIA_CUBEB_INITIALIZATION_ERR;
}
cubeb_channel_layout layout;
int r = cubeb_get_preferred_channel_layout(cubebContext, &layout);
MOZ_ASSERT(r == CUBEB_OK || r == CUBEB_ERROR_NOT_SUPPORTED);
params.layout = (r == CUBEB_OK) ? layout : CUBEB_LAYOUT_UNDEFINED;
// The DecodedAudioDataSink forces mono or stereo for now.
params.layout = params.channels == 1 ? CUBEB_LAYOUT_MONO
: CUBEB_LAYOUT_STEREO;
return OpenCubeb(cubebContext, params, startTime, CubebUtils::GetFirstStream());
}

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

@ -639,10 +639,8 @@ AudioCallbackDriver::Init()
output.format = CUBEB_SAMPLE_FLOAT32NE;
}
cubeb_channel_layout layout;
int r = cubeb_get_preferred_channel_layout(cubebContext, &layout);
MOZ_ASSERT(r == CUBEB_OK || r == CUBEB_ERROR_NOT_SUPPORTED);
output.layout = (r == CUBEB_OK) ? layout : CUBEB_LAYOUT_UNDEFINED;
// Graphs are always stereo for now.
output.layout = CUBEB_LAYOUT_STEREO;
Maybe<uint32_t> latencyPref = CubebUtils::GetCubebMSGLatencyInFrames();
if (latencyPref) {