summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-10-01 11:00:43 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-10-01 11:00:43 +0200
commit94d6babb952f5efd76f92bbf38320563bc860e9c (patch)
treebd2c640d6a43a597489a9d315961f89bb3e0db19 /audio/out
parentf210244a1c131e73ed9deaf1dc33c011d7a5bd30 (diff)
downloadmpv-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')
-rw-r--r--audio/out/ao_coreaudio.c14
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;