mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
af: remove force option
Dangerous and misleading. If it turns out that this is actually needed to make certain setups work right, it should be added back in a better way (in a way it doesn't cause random crashes).
This commit is contained in:
parent
bc268b313e
commit
f9a6b1c3f8
@ -421,8 +421,6 @@ int af_reinit(struct af_stream *s)
|
||||
af = af->next;
|
||||
break;
|
||||
case AF_FALSE: { // Configuration filter is needed
|
||||
// Do auto insertion only if force is not specified
|
||||
if ((AF_INIT_TYPE_MASK & s->cfg.force) != AF_INIT_FORCE) {
|
||||
int progress = 0;
|
||||
if (af_fix_channels(s, &af, in) == AF_OK)
|
||||
progress = 1;
|
||||
@ -433,25 +431,14 @@ int af_reinit(struct af_stream *s)
|
||||
continue;
|
||||
}
|
||||
goto negotiate_error;
|
||||
} else {
|
||||
mp_msg(
|
||||
MSGT_AFILTER, MSGL_ERR,
|
||||
"[libaf] Automatic filter insertion disabled "
|
||||
"but formats do not match. Giving up.\n");
|
||||
return AF_ERROR;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case AF_DETACH: { // Filter is redundant and wants to be unloaded
|
||||
// Do auto remove only if force is not specified
|
||||
if ((AF_INIT_TYPE_MASK & s->cfg.force) != AF_INIT_FORCE) {
|
||||
struct af_instance *aft = af->prev;
|
||||
af_remove(s, af);
|
||||
if (aft)
|
||||
af = aft->next;
|
||||
else
|
||||
af = s->first; // Restart configuration
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -558,7 +545,6 @@ int af_init(struct af_stream *s)
|
||||
return -1;
|
||||
|
||||
// Check output format
|
||||
if ((AF_INIT_TYPE_MASK & s->cfg.force) != AF_INIT_FORCE) {
|
||||
struct af_instance *af = NULL; // New filter
|
||||
// Check output frequency if not OK fix with resample
|
||||
if (s->output.rate && s->last->data->rate != s->output.rate) {
|
||||
@ -598,7 +584,6 @@ int af_init(struct af_stream *s)
|
||||
af_uninit(s);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user