summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-11-09 00:30:42 +0100
committerwm4 <wm4@nowhere>2013-11-09 01:27:03 +0100
commit370c5cc834f455106e682f8af4255a9bc671a01b (patch)
tree50e58a25e5f3b66d0bd0b8819dd8ab4c76e89e27
parent782c8e72ffbc81f23bfa734c0f681f15e0b9b2a5 (diff)
downloadmpv-370c5cc834f455106e682f8af4255a9bc671a01b.tar.bz2
mpv-370c5cc834f455106e682f8af4255a9bc671a01b.tar.xz
af: always remove auto-inserted filters, improve error message
It's probably better if all auto-inserted filters are removed when doing an af_add operation. If they're really needed, they will be automatically re-added. Fix the error message. It used to be for an actual internal error, but now it happens when format negotiation fails, e.g. when trying to use spdif and real audio filters.
-rw-r--r--audio/filter/af.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/audio/filter/af.c b/audio/filter/af.c
index 4c7d2e9bf5..9c39173f1b 100644
--- a/audio/filter/af.c
+++ b/audio/filter/af.c
@@ -509,6 +509,7 @@ static int af_fix_rate(struct af_stream *s, struct af_instance **p_af,
// In that case, you should always rebuild the filter chain, or abort.
static int af_reinit(struct af_stream *s)
{
+ remove_auto_inserted_filters(s);
// Start with the second filter, as the first filter is the special input
// filter which needs no initialization.
struct af_instance *af = s->first->next;
@@ -573,8 +574,8 @@ static int af_reinit(struct af_stream *s)
return af_config_equals(&s->output, &s->filter_output) ? AF_OK : AF_ERROR;
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");
+ mp_msg(MSGT_AFILTER, MSGL_ERR, "[libaf] Unable to convert audio input "
+ "format to output format.\n");
af_print_filter_chain(s, af, MSGL_ERR);
return AF_ERROR;
}
@@ -652,8 +653,6 @@ int af_init(struct af_stream *s)
}
}
- remove_auto_inserted_filters(s);
-
if (af_reinit(s) != AF_OK) {
// Something is stuffed audio out will not work
mp_msg(MSGT_AFILTER, MSGL_ERR, "Could not create audio filter chain.\n");