From 65571dd0d543ced01fc2d10f1fcb8fea933f1e9b Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 9 Nov 2013 23:18:24 +0100 Subject: af: allow filters to return AF_OK, even if format doesn't match This should allow to make format negotiation much simpler, since it takes the responsibility to compare actual input and accepted input formats from the filters. It's also backwards compatible. Filters which have expensive initialization still can use the old method. --- audio/filter/af.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'audio') diff --git a/audio/filter/af.c b/audio/filter/af.c index 9c39173f1b..cfe4b401df 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -527,6 +527,8 @@ static int af_reinit(struct af_stream *s) in.len = 0; int rv = af->control(af, AF_CONTROL_REINIT, &in); + if (rv == AF_OK && !mp_audio_config_equals(&in, af->prev->data)) + rv = AF_FALSE; // conversion filter needed switch (rv) { case AF_OK: af = af->next; -- cgit v1.2.3