1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-21 22:30:22 +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:
wm4 2013-03-28 22:38:47 +01:00
parent bc268b313e
commit f9a6b1c3f8

View File

@ -421,8 +421,6 @@ int af_reinit(struct af_stream *s)
af = af->next; af = af->next;
break; break;
case AF_FALSE: { // Configuration filter is needed 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; int progress = 0;
if (af_fix_channels(s, &af, in) == AF_OK) if (af_fix_channels(s, &af, in) == AF_OK)
progress = 1; progress = 1;
@ -433,25 +431,14 @@ int af_reinit(struct af_stream *s)
continue; continue;
} }
goto negotiate_error; 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 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; struct af_instance *aft = af->prev;
af_remove(s, af); af_remove(s, af);
if (aft) if (aft)
af = aft->next; af = aft->next;
else else
af = s->first; // Restart configuration af = s->first; // Restart configuration
}
break; break;
} }
default: default:
@ -558,7 +545,6 @@ int af_init(struct af_stream *s)
return -1; return -1;
// Check output format // Check output format
if ((AF_INIT_TYPE_MASK & s->cfg.force) != AF_INIT_FORCE) {
struct af_instance *af = NULL; // New filter struct af_instance *af = NULL; // New filter
// Check output frequency if not OK fix with resample // Check output frequency if not OK fix with resample
if (s->output.rate && s->last->data->rate != s->output.rate) { 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); af_uninit(s);
return -1; return -1;
} }
}
return 0; return 0;
} }