summaryrefslogtreecommitdiffstats
path: root/audio/out/ao.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-21 18:43:03 +0100
committerwm4 <wm4@nowhere>2013-12-21 20:50:12 +0100
commit138d183d83b4ef58aa1d62203b27a5df9792e93b (patch)
treef8ed51748a9ba5349b9bc03342625f7c86f1b2ac /audio/out/ao.c
parent7cc3c3aeec702898a1722cbd8ce1dd8b4658c4be (diff)
downloadmpv-138d183d83b4ef58aa1d62203b27a5df9792e93b.tar.bz2
mpv-138d183d83b4ef58aa1d62203b27a5df9792e93b.tar.xz
ao: some missing mp_msg conversions
Diffstat (limited to 'audio/out/ao.c')
-rw-r--r--audio/out/ao.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index ddd177400d..ab2b15b031 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -176,33 +176,37 @@ struct ao *ao_init_best(struct mpv_global *global,
struct encode_lavc_context *encode_lavc_ctx,
int samplerate, int format, struct mp_chmap channels)
{
+ struct mp_log *log = mp_log_new(NULL, global->log, "ao");
+ struct ao *ao = NULL;
struct m_obj_settings *ao_list = global->opts->audio_driver_list;
if (ao_list && ao_list[0].name) {
for (int n = 0; ao_list[n].name; n++) {
if (strlen(ao_list[n].name) == 0)
goto autoprobe;
- mp_msg(MSGT_AO, MSGL_V, "Trying preferred audio driver '%s'\n",
- ao_list[n].name);
- struct ao *ao = ao_create(false, global, input_ctx, encode_lavc_ctx,
- samplerate, format, channels,
- ao_list[n].name, ao_list[n].attribs);
+ mp_verbose(log, "Trying preferred audio driver '%s'\n",
+ ao_list[n].name);
+ ao = ao_create(false, global, input_ctx, encode_lavc_ctx,
+ samplerate, format, channels,
+ ao_list[n].name, ao_list[n].attribs);
if (ao)
- return ao;
- mp_msg(MSGT_AO, MSGL_WARN, "Failed to initialize audio driver '%s'\n",
+ goto done;
+ mp_warn(log, "Failed to initialize audio driver '%s'\n",
ao_list[n].name);
}
- return NULL;
+ goto done;
}
autoprobe:
// now try the rest...
for (int i = 0; audio_out_drivers[i]; i++) {
- struct ao *ao = ao_create(true, global, input_ctx, encode_lavc_ctx,
- samplerate, format, channels,
- (char *)audio_out_drivers[i]->name, NULL);
+ ao = ao_create(true, global, input_ctx, encode_lavc_ctx,
+ samplerate, format, channels,
+ (char *)audio_out_drivers[i]->name, NULL);
if (ao)
- return ao;
+ goto done;
}
- return NULL;
+done:
+ talloc_free(log);
+ return ao;
}
void ao_uninit(struct ao *ao, bool cut_audio)