diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-10-01 11:00:43 +0200 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2013-10-01 11:00:43 +0200 |
commit | 94d6babb952f5efd76f92bbf38320563bc860e9c (patch) | |
tree | bd2c640d6a43a597489a9d315961f89bb3e0db19 /audio/out/ao_coreaudio.c | |
parent | f210244a1c131e73ed9deaf1dc33c011d7a5bd30 (diff) | |
download | mpv-94d6babb952f5efd76f92bbf38320563bc860e9c.tar.bz2 mpv-94d6babb952f5efd76f92bbf38320563bc860e9c.tar.xz |
ao_coreaudio: fetch device name only for verbose log level
The previous code fetched the device name regardless of log level and then
only printed it if log level was verbose.
Diffstat (limited to 'audio/out/ao_coreaudio.c')
-rw-r--r-- | audio/out/ao_coreaudio.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/audio/out/ao_coreaudio.c b/audio/out/ao_coreaudio.c index a7e7b11966..cba0900973 100644 --- a/audio/out/ao_coreaudio.c +++ b/audio/out/ao_coreaudio.c @@ -267,14 +267,16 @@ static int init(struct ao *ao) selected_device = p->opt_device_id; } - char *device_name; - err = CA_GET_STR(selected_device, kAudioObjectPropertyName, &device_name); - CHECK_CA_ERROR("could not get selected audio device name"); + if (mp_msg_test_log(ao->log, MSGL_V)) { + char *name; + err = CA_GET_STR(selected_device, kAudioObjectPropertyName, &name); + CHECK_CA_ERROR("could not get selected audio device name"); - MP_VERBOSE(ao, "selected audio output device: %s (%" PRIu32 ")\n", - device_name, selected_device); + MP_VERBOSE(ao, "selected audio output device: %s (%" PRIu32 ")\n", + name, selected_device); - talloc_free(device_name); + talloc_free(name); + } // Save selected device id p->device = selected_device; |