mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 14:29:25 +08:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user