Bug 839319 - Initialize WAVE_FORMAT_EXTENSIBLE correctly in cubeb winmm backend. r=doublec

This commit is contained in:
Matthew Gregan 2013-02-08 14:00:24 +13:00
Родитель 2e9b709251
Коммит aa5551739a
2 изменённых файлов: 5 добавлений и 14 удалений

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

@ -5,4 +5,5 @@ Makefile.in build files for the Mozilla build system.
The cubeb git repository is: git://github.com/kinetiknz/cubeb.git
The git commit ID used was 0f53b9b70c4e6af9da4a7eb0d38a7757c5a10edd..
The git commit ID used was 0f53b9b70c4e6af9da4a7eb0d38a7757c5a10edd.
Plus the single commit e945dbd052793a7faba3e9064d03bd6781b02692.

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

@ -331,16 +331,8 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n
}
memset(&wfx, 0, sizeof(wfx));
if (stream_params.channels > 2) {
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfx.Format.cbSize = sizeof(wfx) - sizeof(wfx.Format);
} else {
wfx.Format.wFormatTag = WAVE_FORMAT_PCM;
if (stream_params.format == CUBEB_SAMPLE_FLOAT32LE) {
wfx.Format.wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
}
wfx.Format.cbSize = 0;
}
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfx.Format.cbSize = sizeof(wfx) - sizeof(wfx.Format);
wfx.Format.nChannels = stream_params.channels;
wfx.Format.nSamplesPerSec = stream_params.rate;
@ -362,9 +354,7 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n
wfx.Format.nBlockAlign = (wfx.Format.wBitsPerSample * wfx.Format.nChannels) / 8;
wfx.Format.nAvgBytesPerSec = wfx.Format.nSamplesPerSec * wfx.Format.nBlockAlign;
wfx.Samples.wValidBitsPerSample = 0;
wfx.Samples.wSamplesPerBlock = 0;
wfx.Samples.wReserved = 0;
wfx.Samples.wValidBitsPerSample = wfx.Format.wBitsPerSample;
EnterCriticalSection(&context->lock);
/* CUBEB_STREAM_MAX is a horrible hack to avoid a situation where, when