summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@mplayer2.org>2011-12-22 08:25:41 +0100
committerUoti Urpala <uau@mplayer2.org>2012-03-09 20:48:54 +0200
commit1f6ba56d6ab699f5a6137a176f8183c82046be43 (patch)
tree319df8b1a77c51a867b49bf28d51f9e87040f9d6
parentf891939b4db79bce39c5f257771557904da4d535 (diff)
downloadmpv-1f6ba56d6ab699f5a6137a176f8183c82046be43.tar.bz2
mpv-1f6ba56d6ab699f5a6137a176f8183c82046be43.tar.xz
af: print audio filter chain in verbose mode
The string format used in print_fmt() is taken from init_audio_filters().
-rw-r--r--libaf/af.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/libaf/af.c b/libaf/af.c
index 80f9871bfb..82a7d7398b 100644
--- a/libaf/af.c
+++ b/libaf/af.c
@@ -246,6 +246,38 @@ void af_remove(af_stream_t* s, af_instance_t* af)
free(af);
}
+static void print_fmt(af_data_t *d)
+{
+ if (d) {
+ mp_msg(MSGT_AFILTER, MSGL_V, "%dHz/%dch/%s", d->rate, d->nch,
+ af_fmt2str_short(d->format));
+ } else {
+ mp_msg(MSGT_AFILTER, MSGL_V, "(?)");
+ }
+}
+
+static void af_print_filter_chain(af_stream_t* s)
+{
+ mp_msg(MSGT_AFILTER, MSGL_V, "Audio filter chain:\n");
+
+ mp_msg(MSGT_AFILTER, MSGL_V, " [in] ");
+ print_fmt(&s->input);
+ mp_msg(MSGT_AFILTER, MSGL_V, "\n");
+
+ af_instance_t *af = s->first;
+ while (af) {
+ mp_msg(MSGT_AFILTER, MSGL_V, " [%s] ", af->info->name);
+ print_fmt(af->data);
+ mp_msg(MSGT_AFILTER, MSGL_V, "\n");
+
+ af = af->next;
+ }
+
+ mp_msg(MSGT_AFILTER, MSGL_V, " [out] ");
+ print_fmt(&s->output);
+ mp_msg(MSGT_AFILTER, MSGL_V, "\n");
+}
+
int af_reinit(af_stream_t* s, af_instance_t* af)
{
do{
@@ -343,6 +375,9 @@ int af_reinit(af_stream_t* s, af_instance_t* af)
return AF_ERROR;
}
}while(af);
+
+ af_print_filter_chain(s);
+
return AF_OK;
}