summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-21 19:45:42 +0100
committerwm4 <wm4@nowhere>2013-12-21 21:05:02 +0100
commitd8d42b44fc717c695af59c14213d54885088ea37 (patch)
tree9dbfd597e3352249cb5d1fda996d2c0ce1602fe9 /audio
parenta2d144fc8f146f96e4fe97b1b2c15828e24f8494 (diff)
downloadmpv-d8d42b44fc717c695af59c14213d54885088ea37.tar.bz2
mpv-d8d42b44fc717c695af59c14213d54885088ea37.tar.xz
m_option, m_config: mp_msg conversions
Always pass around mp_log contexts in the option parser code. This of course affects all users of this API as well. In stream.c, pass a mp_null_log, because we can't do it properly yet. This will be fixed later.
Diffstat (limited to 'audio')
-rw-r--r--audio/chmap.c16
-rw-r--r--audio/chmap.h4
-rw-r--r--audio/filter/af.c2
-rw-r--r--audio/out/ao.c2
4 files changed, 13 insertions, 11 deletions
diff --git a/audio/chmap.c b/audio/chmap.c
index ce301b6565..a67c4e1c70 100644
--- a/audio/chmap.c
+++ b/audio/chmap.c
@@ -471,19 +471,19 @@ bool mp_chmap_from_str(struct mp_chmap *dst, bstr src)
return true;
}
-void mp_chmap_print_help(int msgt, int msgl)
+void mp_chmap_print_help(struct mp_log *log)
{
- mp_msg(msgt, msgl, "Speakers:\n");
+ mp_info(log, "Speakers:\n");
for (int n = 0; n < MP_SPEAKER_ID_COUNT; n++) {
if (speaker_names[n][0])
- mp_msg(msgt, msgl, " %-16s (%s)\n",
- speaker_names[n][0], speaker_names[n][1]);
+ mp_info(log, " %-16s (%s)\n",
+ speaker_names[n][0], speaker_names[n][1]);
}
- mp_msg(msgt, msgl, "Standard layouts:\n");
+ mp_info(log, "Standard layouts:\n");
for (int n = 0; std_layout_names[n][0]; n++) {
- mp_msg(msgt, msgl, " %-16s (%s)\n",
- std_layout_names[n][0], std_layout_names[n][1]);
+ mp_info(log, " %-16s (%s)\n",
+ std_layout_names[n][0], std_layout_names[n][1]);
}
for (int n = 0; n < MP_NUM_CHANNELS; n++)
- mp_msg(msgt, msgl, " unknown%d\n", n);
+ mp_info(log, " unknown%d\n", n);
}
diff --git a/audio/chmap.h b/audio/chmap.h
index ca1e6c2508..306382db5a 100644
--- a/audio/chmap.h
+++ b/audio/chmap.h
@@ -121,7 +121,9 @@ void mp_chmap_get_reorder(int dst[MP_NUM_CHANNELS], const struct mp_chmap *from,
char *mp_chmap_to_str(const struct mp_chmap *src);
bool mp_chmap_from_str(struct mp_chmap *dst, bstr src);
-void mp_chmap_print_help(int msgt, int msgl);
+
+struct mp_log;
+void mp_chmap_print_help(struct mp_log *log);
// Use these to avoid chaos in case lavc's definition should diverge from MS.
#define mp_chmap_to_waveext mp_chmap_to_lavc
diff --git a/audio/filter/af.c b/audio/filter/af.c
index 3eebd8b385..92ed2ad63e 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -205,7 +205,7 @@ static struct af_instance *af_create(struct af_stream *s, char *name,
.data = talloc_zero(af, struct mp_audio),
.log = mp_log_new(af, s->log, name),
};
- struct m_config *config = m_config_from_obj_desc(af, &desc);
+ struct m_config *config = m_config_from_obj_desc(af, s->log, &desc);
if (m_config_apply_defaults(config, name, s->opts->af_defs) < 0)
goto error;
if (m_config_set_obj_params(config, args) < 0)
diff --git a/audio/out/ao.c b/audio/out/ao.c
index ab2b15b031..7aea6239d2 100644
--- a/audio/out/ao.c
+++ b/audio/out/ao.c
@@ -149,7 +149,7 @@ static struct ao *ao_create(bool probing, struct mpv_global *global,
};
if (ao->driver->encode != !!ao->encode_lavc_ctx)
goto error;
- struct m_config *config = m_config_from_obj_desc(ao, &desc);
+ struct m_config *config = m_config_from_obj_desc(ao, ao->log, &desc);
if (m_config_apply_defaults(config, name, global->opts->ao_defs) < 0)
goto error;
if (m_config_set_obj_params(config, args) < 0)