diff options
author | wm4 <wm4@nowhere> | 2013-07-22 14:43:34 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-07-22 15:06:43 +0200 |
commit | 221ef23d0d4454af974b08e68fad6b898d1d8e12 (patch) | |
tree | 08c85d394430d5e69cc80963d1ce44c69de2da6b /audio | |
parent | 0c9b0ba40dfd5954c04882d5f3c7d84c1e7681b4 (diff) | |
download | mpv-221ef23d0d4454af974b08e68fad6b898d1d8e12.tar.bz2 mpv-221ef23d0d4454af974b08e68fad6b898d1d8e12.tar.xz |
af_force: add option that causes filter to fail at initialization
This is useful for debugging.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/filter/af_force.c | 10 |
1 files changed, 9 insertions, 1 deletions
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; } |