Bug 842176 - Partial revert of bug 839319; use WAVE_FORMATEX when channels <= 2. r=doublec

This commit is contained in:
Matthew Gregan 2013-02-18 15:06:30 +13:00
Родитель 256a511da6
Коммит 488cbf6168
2 изменённых файлов: 11 добавлений и 3 удалений

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

@ -5,4 +5,4 @@ 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 e945dbd052793a7faba3e9064d03bd6781b02692.
The git commit ID used was 49f2565ff54192821b9b717988399a875d3b1c61.

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

@ -331,8 +331,16 @@ cubeb_stream_init(cubeb * context, cubeb_stream ** stream, char const * stream_n
}
memset(&wfx, 0, sizeof(wfx));
wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;
wfx.Format.cbSize = sizeof(wfx) - sizeof(wfx.Format);
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.nChannels = stream_params.channels;
wfx.Format.nSamplesPerSec = stream_params.rate;