From a90a7c56771113eb444ecfaa1b49ead6926f0d40 Mon Sep 17 00:00:00 2001 From: Michael Wu Date: Fri, 19 Jul 2013 21:16:41 -0400 Subject: [PATCH] Update libcubeb to pick up bug 895378 (r=kinetik) and bug 889652 (r=kinetik) --- media/libcubeb/README_MOZILLA | 2 +- media/libcubeb/src/cubeb_pulse.c | 14 +++++++++++--- media/libcubeb/src/cubeb_wasapi.cpp | 5 +++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/media/libcubeb/README_MOZILLA b/media/libcubeb/README_MOZILLA index 4fa5806d88e1..d8858e4a28ef 100644 --- a/media/libcubeb/README_MOZILLA +++ b/media/libcubeb/README_MOZILLA @@ -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 3246b37960ac519aaea505bab0060c7484746f35. +The git commit ID used was f82d1c2c269c452ac4052da404c6b0a42aff3c66. diff --git a/media/libcubeb/src/cubeb_pulse.c b/media/libcubeb/src/cubeb_pulse.c index 6f8f79eb58b5..be481d06d7dd 100644 --- a/media/libcubeb/src/cubeb_pulse.c +++ b/media/libcubeb/src/cubeb_pulse.c @@ -13,6 +13,10 @@ #include "cubeb/cubeb.h" #include "cubeb-internal.h" +#ifdef DISABLE_LIBPULSE_DLOPEN +#define WRAP(x) x +#else +#define WRAP(x) cubeb_##x #define MAKE_TYPEDEF(x) static typeof(x) * cubeb_##x MAKE_TYPEDEF(pa_channel_map_init_auto); MAKE_TYPEDEF(pa_context_connect); @@ -55,7 +59,7 @@ MAKE_TYPEDEF(pa_threaded_mainloop_unlock); MAKE_TYPEDEF(pa_threaded_mainloop_wait); MAKE_TYPEDEF(pa_usec_to_bytes); #undef MAKE_TYPEDEF -#define WRAP(x) cubeb_##x +#endif static struct cubeb_ops const pulse_ops; @@ -270,11 +274,12 @@ static void pulse_destroy(cubeb * ctx); /*static*/ int pulse_init(cubeb ** context, char const * context_name) { - void * libpulse; + void * libpulse = NULL; cubeb * ctx; *context = NULL; +#ifndef DISABLE_LIBPULSE_DLOPEN libpulse = dlopen("libpulse.so.0", RTLD_LAZY); if (!libpulse) { return CUBEB_ERROR; @@ -328,6 +333,7 @@ pulse_init(cubeb ** context, char const * context_name) LOAD(pa_threaded_mainloop_wait); LOAD(pa_usec_to_bytes); #undef LOAD +#endif ctx = calloc(1, sizeof(*ctx)); assert(ctx); @@ -400,7 +406,9 @@ pulse_destroy(cubeb * ctx) WRAP(pa_threaded_mainloop_free)(ctx->mainloop); } - dlclose(ctx->libpulse); + if (ctx->libpulse) { + dlclose(ctx->libpulse); + } if (ctx->default_sink_info) { free(ctx->default_sink_info); } diff --git a/media/libcubeb/src/cubeb_wasapi.cpp b/media/libcubeb/src/cubeb_wasapi.cpp index 22a7b038ae84..2817c0dd3dde 100644 --- a/media/libcubeb/src/cubeb_wasapi.cpp +++ b/media/libcubeb/src/cubeb_wasapi.cpp @@ -289,6 +289,11 @@ wasapi_stream_render_loop(LPVOID stream) switch (waitResult) { case WAIT_OBJECT_0: { /* shutdown */ is_playing = false; + /* We don't check if the drain is actually finished here, we just want to + * shutdown. */ + if (stm->draining) { + stm->state_callback(stm, stm->user_ptr, CUBEB_STATE_DRAINED); + } continue; } case WAIT_OBJECT_0 + 1: { /* refill */