From 221ef23d0d4454af974b08e68fad6b898d1d8e12 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 22 Jul 2013 14:43:34 +0200 Subject: af_force: add option that causes filter to fail at initialization This is useful for debugging. --- audio/filter/af_force.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/filter/af_force.c b/audio/filter/af_force.c index 51fe83d0f0..765a77750f 100644 --- a/audio/filter/af_force.c +++ b/audio/filter/af_force.c @@ -35,6 +35,8 @@ struct priv { int out_srate; struct mp_chmap out_channels; + int fail; + struct mp_audio data; struct mp_audio temp; }; @@ -53,6 +55,7 @@ static const struct m_option options[] = { OPT_AUDIOFORMAT("out-format", out_format, 0), OPT_INTRANGE("out-srate", out_srate, 0, 1000, 8*48000), OPT_CHMAP("out-channels", out_channels, CONF_MIN, .min = 0), + OPT_FLAG("fail", fail, 0), {0} }; @@ -88,7 +91,12 @@ static int control(struct af_instance *af, int cmd, void *arg) if (in->nch != out->nch || in->bps != out->bps) { mp_msg(MSGT_AFILTER, MSGL_ERR, - "[af_force] Forced input/output format are incompatible.\n"); + "[af_force] Forced input/output formats are incompatible.\n"); + return AF_ERROR; + } + + if (priv->fail) { + mp_msg(MSGT_AFILTER, MSGL_ERR, "[af_force] Failing on purpose.\n"); return AF_ERROR; } -- cgit v1.2.3