summaryrefslogtreecommitdiffstats
path: root/audio/filter/af.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-04-07 22:54:42 +0200
committerwm4 <wm4@nowhere>2013-05-12 21:24:56 +0200
commit9afad5180cf5846fa26a5813e872eec30ffa2776 (patch)
tree0600d3c603c8aec9795bbda68ee03a2fd49ef09e /audio/filter/af.c
parentd2e5b500413c379ff11bf1fb5acab6608e355862 (diff)
downloadmpv-9afad5180cf5846fa26a5813e872eec30ffa2776.tar.bz2
mpv-9afad5180cf5846fa26a5813e872eec30ffa2776.tar.xz
af: print filter chain info on error
The filter chain was only visible with -v. Always print it if the filter chain could not be configured.
Diffstat (limited to 'audio/filter/af.c')
-rw-r--r--audio/filter/af.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c
index 3bc9ae764d..b5cce39dd0 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -301,36 +301,37 @@ repeat:
}
}
-static void print_fmt(struct mp_audio *d)
+static void print_fmt(struct mp_audio *d, int msg_level)
{
if (d) {
char *chstr = mp_chmap_to_str(&d->channels);
- mp_msg(MSGT_AFILTER, MSGL_V, "%dHz/%s(%dch)/%s", d->rate,
+ mp_msg(MSGT_AFILTER, msg_level, "%dHz/%s(%dch)/%s", d->rate,
chstr ? chstr : "?", d->nch,
af_fmt2str_short(d->format));
talloc_free(chstr);
} else
- mp_msg(MSGT_AFILTER, MSGL_V, "(?)");
+ mp_msg(MSGT_AFILTER, msg_level, "(?)");
}
-static void af_print_filter_chain(struct af_stream *s, struct af_instance *at)
+static void af_print_filter_chain(struct af_stream *s, struct af_instance *at,
+ int msg_level)
{
- mp_msg(MSGT_AFILTER, MSGL_V, "Audio filter chain:\n");
+ mp_msg(MSGT_AFILTER, msg_level, "Audio filter chain:\n");
struct af_instance *af = s->first;
while (af) {
- mp_msg(MSGT_AFILTER, MSGL_V, " [%s] ", af->info->name);
- print_fmt(af->data);
+ mp_msg(MSGT_AFILTER, msg_level, " [%s] ", af->info->name);
+ print_fmt(af->data, msg_level);
if (af == at)
- mp_msg(MSGT_AFILTER, MSGL_V, " <-");
- mp_msg(MSGT_AFILTER, MSGL_V, "\n");
+ mp_msg(MSGT_AFILTER, msg_level, " <-");
+ mp_msg(MSGT_AFILTER, msg_level, "\n");
af = af->next;
}
- mp_msg(MSGT_AFILTER, MSGL_V, " [ao] ");
- print_fmt(&s->output);
- mp_msg(MSGT_AFILTER, MSGL_V, "\n");
+ mp_msg(MSGT_AFILTER, msg_level, " [ao] ");
+ print_fmt(&s->output, msg_level);
+ mp_msg(MSGT_AFILTER, msg_level, "\n");
}
static const char *af_find_conversion_filter(int srcfmt, int dstfmt)
@@ -486,19 +487,19 @@ int af_reinit(struct af_stream *s)
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Reinitialization did not "
"work, audio filter '%s' returned error code %i\n",
af->info->name, rv);
- af_print_filter_chain(s, af);
+ af_print_filter_chain(s, af, MSGL_ERR);
return AF_ERROR;
}
}
- af_print_filter_chain(s, NULL);
+ af_print_filter_chain(s, NULL, MSGL_V);
return AF_OK;
negotiate_error:
mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Unable to correct audio format. "
"This error should never occur, please send a bug report.\n");
- af_print_filter_chain(s, af);
+ af_print_filter_chain(s, af, MSGL_ERR);
return AF_ERROR;
}