Bug 971693 - Fallback properly when WASAPI does not give us a stream format suggestion. r=kinetik

--HG--
extra : rebase_source : 495fdf5ad7f4a1069d9c0b9db186a0b717d18759
This commit is contained in:
Paul Adenot 2014-02-27 14:36:58 +01:00
Родитель 04632f8c63
Коммит 143d5497f6
1 изменённых файлов: 4 добавлений и 2 удалений

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

@ -641,6 +641,7 @@ handle_channel_layout(cubeb_stream * stm, WAVEFORMATEX ** mix_format, const cub
}
/* Otherwise, the hardware supports more than two channels. */
WAVEFORMATEX hw_mixformat = **mix_format;
/* The docs say that GetMixFormat is always of type WAVEFORMATEXTENSIBLE [1],
* so the reinterpret_cast below should be safe. In practice, this is not
@ -688,8 +689,9 @@ handle_channel_layout(cubeb_stream * stm, WAVEFORMATEX ** mix_format, const cub
*mix_format = closest;
} else if (hr == AUDCLNT_E_UNSUPPORTED_FORMAT) {
/* Not supported, no suggestion. This should not happen, but it does in the
* field with some sound cards. We simply bail out and let the rest of the
* code figure out the right conversion path. */
* field with some sound cards. We restore the mix format, and let the rest
* of the code figure out the right conversion path. */
**mix_format = hw_mixformat;
} else if (hr == S_OK) {
LOG("Requested format accepted by WASAPI.");
}