Make RAW WASAPI streams opt-in

This commit is contained in:
Paul Adenot 2020-10-06 13:24:04 +02:00
Родитель 2141a1e08b
Коммит b33659d9be
2 изменённых файлов: 9 добавлений и 4 удалений

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

@ -230,12 +230,14 @@ typedef enum {
CUBEB_STREAM_PREF_DISABLE_DEVICE_SWITCHING = 0x02, /**< Disable switching
default device on OS
changes. */
CUBEB_STREAM_PREF_VOICE = 0x04 /**< This stream is going to transport voice data.
CUBEB_STREAM_PREF_VOICE = 0x04, /**< This stream is going to transport voice data.
Depending on the backend and platform, this can
change the audio input or output devices
selected, as well as the quality of the stream,
for example to accomodate bluetooth SCO modes on
bluetooth devices. */
CUBEB_STREAM_PREF_RAW = 0x08 /**< Windows only. Bypass all signal processing
except for always on APO, driver and hardware. */
} cubeb_stream_prefs;
/** Stream format initialization parameters. */

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

@ -2102,9 +2102,12 @@ int setup_wasapi_stream_one_side(cubeb_stream * stm,
LOG("Could not get cubeb_device_info.");
}
if (initialize_iaudioclient2(audio_client) != CUBEB_OK) {
LOG("Can't create the reconfigure event, error: %lx", GetLastError());
// This is not fatal.
if (stm->output_stream_params.prefs & CUBEB_STREAM_PREF_RAW ||
stm->input_stream_params.prefs & CUBEB_STREAM_PREF_RAW) {
if (initialize_iaudioclient2(audio_client) != CUBEB_OK) {
LOG("Can't initialize an IAudioClient2, error: %lx", GetLastError());
// This is not fatal.
}
}
#if 0 // See https://bugzilla.mozilla.org/show_bug.cgi?id=1590902