diff options
Diffstat (limited to 'src/cubeb.c')
-rw-r--r-- | src/cubeb.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/cubeb.c b/src/cubeb.c index 7f14bfa..ea21046 100644 --- a/src/cubeb.c +++ b/src/cubeb.c @@ -639,7 +639,7 @@ cubeb_enumerate_devices(cubeb * context, cubeb_device_type devtype, rv = context->ops->enumerate_devices(context, devtype, collection); - if (g_cubeb_log_callback) { + if (cubeb_log_get_callback()) { for (size_t i = 0; i < collection->count; i++) { log_device(&collection->device[i]); } @@ -701,21 +701,11 @@ cubeb_set_log_callback(cubeb_log_level log_level, return CUBEB_ERROR_INVALID_PARAMETER; } - if (g_cubeb_log_callback && log_callback) { + if (cubeb_log_get_callback() && log_callback) { return CUBEB_ERROR_NOT_SUPPORTED; } - g_cubeb_log_callback = log_callback; - g_cubeb_log_level = log_level; - - // Logging a message here allows to initialize the asynchronous logger from a - // thread that is not the audio rendering thread, and especially to not - // initialize it the first time we find a verbose log, which is often in the - // audio rendering callback, that runs from the audio rendering thread, and - // that is high priority, and that we don't want to block. - if (log_level >= CUBEB_LOG_VERBOSE) { - ALOGV("Starting cubeb log"); - } + cubeb_log_set(log_level, log_callback); return CUBEB_OK; } |