Bug 1286041 - AudioStream disable the assert when backend audio is winmm. r=padenot

This commit is contained in:
Alex Chronopoulos 2016-09-12 12:25:19 +03:00
Родитель 2764b5a648
Коммит c498e1f9a0
1 изменённых файлов: 11 добавлений и 1 удалений

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

@ -597,7 +597,17 @@ AudioStream::DataCallback(void* aBuffer, long aFrames)
auto writer = AudioBufferWriter(
reinterpret_cast<AudioDataValue*>(aBuffer), mOutChannels, aFrames);
MOZ_ASSERT(mState != INITIALIZED);
if (!strcmp(cubeb_get_backend_id(CubebUtils::GetCubebContext()), "winmm")) {
// Don't consume audio data until Start() is called.
// Expected only with cubeb winmm backend.
if (mState == INITIALIZED) {
NS_WARNING("data callback fires before cubeb_stream_start() is called");
mAudioClock.UpdateFrameHistory(0, aFrames);
return writer.WriteZeros(aFrames);
}
} else {
MOZ_ASSERT(mState != INITIALIZED);
}
// NOTE: wasapi (others?) can call us back *after* stop()/Shutdown() (mState == SHUTDOWN)
// Bug 996162