Bug 1471164 - Update cubeb from upstream to 2968cba. r=padenot

MozReview-Commit-ID: Lwalw9Hxf70

--HG--
extra : rebase_source : 183ac07e38e329e84f7a567d0e287206c0215524
This commit is contained in:
Alex Chronopoulos 2018-06-26 12:16:49 +02:00
Родитель f3554479ca
Коммит b2ea3d0293
4 изменённых файлов: 24 добавлений и 16 удалений

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

@ -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 0677b3027b78c629586b099b5155aa6ac7422674 (2018-06-12 08:48:55 -0700)
The git commit ID used was 2968cba6474822535275225e4583c67c6aaaf2ae (2018-06-26 10:58:56 +0200)

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

@ -2585,6 +2585,8 @@ cubeb_stream::cubeb_stream(cubeb * context)
PodZero(&output_desc, 1);
}
static void audiounit_stream_destroy_internal(cubeb_stream * stm);
static int
audiounit_stream_init(cubeb * context,
cubeb_stream ** stream,
@ -2602,14 +2604,10 @@ audiounit_stream_init(cubeb * context,
auto_lock context_lock(context->mutex);
audiounit_increment_active_streams(context);
unique_ptr<cubeb_stream, decltype(&audiounit_stream_destroy)> stm(new cubeb_stream(context),
audiounit_stream_destroy);
audiounit_stream_destroy_internal);
int r;
*stream = NULL;
assert(latency_frames > 0);
if ((input_device && !input_stream_params) ||
(output_device && !output_stream_params)) {
return CUBEB_ERROR_INVALID_PARAMETER;
}
/* These could be different in the future if we have both
* full-duplex stream and different devices for input vs output. */
@ -2617,6 +2615,11 @@ audiounit_stream_init(cubeb * context,
stm->state_callback = state_callback;
stm->user_ptr = user_ptr;
stm->latency_frames = latency_frames;
if ((input_device && !input_stream_params) ||
(output_device && !output_stream_params)) {
return CUBEB_ERROR_INVALID_PARAMETER;
}
if (input_stream_params) {
stm->input_stream_params = *input_stream_params;
r = audiounit_set_device_info(stm.get(), reinterpret_cast<uintptr_t>(input_device), INPUT);
@ -2687,33 +2690,39 @@ audiounit_close_stream(cubeb_stream *stm)
}
static void
audiounit_stream_destroy(cubeb_stream * stm)
audiounit_stream_destroy_internal(cubeb_stream *stm)
{
stm->shutdown = true;
stm->context->mutex.assert_current_thread_owns();
int r = audiounit_uninstall_system_changed_callback(stm);
if (r != CUBEB_OK) {
LOG("(%p) Could not uninstall the device changed callback", stm);
}
r = audiounit_uninstall_device_changed_callback(stm);
if (r != CUBEB_OK) {
LOG("(%p) Could not uninstall all device change listeners", stm);
}
{
auto_lock lock(stm->mutex);
audiounit_close_stream(stm);
assert(audiounit_active_streams(stm->context) >= 1);
audiounit_decrement_active_streams(stm->context);
}
static void
audiounit_stream_destroy(cubeb_stream * stm)
{
if (!stm->shutdown.load()){
auto_lock context_lock(stm->context->mutex);
audiounit_stream_stop_internal(stm);
stm->shutdown = true;
}
// Execute close in serial queue to avoid collision
// with reinit when un/plug devices
dispatch_sync(stm->context->serial_queue, ^() {
auto_lock lock(stm->mutex);
audiounit_close_stream(stm);
auto_lock context_lock(stm->context->mutex);
assert(audiounit_active_streams(stm->context) >= 1);
audiounit_decrement_active_streams(stm->context);
audiounit_stream_destroy_internal(stm);
});
LOG("Cubeb stream (%p) destroyed successful.", stm);

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

@ -871,7 +871,7 @@ wasapi_stream_render_loop(LPVOID stream)
the timeout error handling only when the timeout_limit is reached, which is
reset on each successful loop. */
unsigned timeout_count = 0;
const unsigned timeout_limit = 5;
const unsigned timeout_limit = 3;
while (is_playing) {
// We want to check the emergency bailout variable before a
// and after the WaitForMultipleObject, because the handles WaitForMultipleObjects

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

@ -4,7 +4,6 @@
* This program is made available under an ISC-style license. See the
* accompanying file LICENSE for details.
*/
#define __MSVCRT_VERSION__ 0x0700
#undef WINVER
#define WINVER 0x0501
#undef WIN32_LEAN_AND_MEAN