summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-12 13:54:02 +0100
committerDiogo Franco (Kovensky) <diogomfranco@gmail.com>2015-02-16 18:08:17 +0900
commit2051243a0fdc4bc2542583d37342c32a93fc3468 (patch)
tree90b7ad7efdacc126d82ee850d6c9ffa2baf0db1b
parenta21d09d9f82ec332ec3f5ce757c90d5b2b823d49 (diff)
downloadmpv-2051243a0fdc4bc2542583d37342c32a93fc3468.tar.bz2
mpv-2051243a0fdc4bc2542583d37342c32a93fc3468.tar.xz
ao: set correct client name when listing devices
This is a small oversight. The client name (as set on command line options or, more importantly, the client API) was not set when listing devices e.g. via the "audio-device-list" property. Might or might not fix #1578. Also adjust the log level for an unrelated message. (cherry picked from commit c152c590843a192761cff585a84ce57385d83d40)
-rw-r--r--audio/out/ao.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/audio/out/ao.c b/audio/out/ao.c
index dbdcf272cb..ccb39f7f9e 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -143,6 +143,7 @@ static struct ao *ao_alloc(bool probing, struct mpv_global *global,
.input_ctx = input_ctx,
.log = mp_log_new(ao, log, name),
.def_buffer = opts->audio_buffer,
+ .client_name = talloc_strdup(ao, opts->audio_client_name),
};
struct m_config *config = m_config_from_obj_desc(ao, ao->log, &desc);
if (m_config_apply_defaults(config, name, opts->ao_defs) < 0)
@@ -162,7 +163,6 @@ static struct ao *ao_init(bool probing, struct mpv_global *global,
int samplerate, int format, struct mp_chmap channels,
char *dev, char *name, char **args)
{
- struct MPOpts *opts = global->opts;
struct ao *ao = ao_alloc(probing, global, input_ctx, name, args);
if (!ao)
return NULL;
@@ -178,7 +178,6 @@ static struct ao *ao_init(bool probing, struct mpv_global *global,
af_fmt_to_str(ao->format));
ao->device = talloc_strdup(ao, dev);
- ao->client_name = talloc_strdup(ao, opts->audio_client_name);
ao->api = ao->driver->play ? &ao_api_push : &ao_api_pull;
ao->api_priv = talloc_zero_size(ao, ao->api->priv_size);
@@ -275,8 +274,8 @@ struct ao *ao_init_best(struct mpv_global *global,
ao_list[n].name, ao_list[n].attribs);
if (ao)
goto done;
- mp_warn(log, "Failed to initialize audio driver '%s'\n",
- ao_list[n].name);
+ mp_err(log, "Failed to initialize audio driver '%s'\n",
+ ao_list[n].name);
if (forced_dev) {
mp_err(log, "This audio driver/device was forced with the "
"--audio-device option.\n"