audio: deprecate most audio filters

Well, ok, only 4 filters. The rest will survive in one or the other
form.
This commit is contained in:
wm4 2017-04-04 15:04:07 +02:00
parent 98f8c4f36d
commit b96a74ec2a
5 changed files with 10 additions and 1 deletions

View File

@ -214,6 +214,8 @@ static int af_open(struct af_instance* af){
af->filter_frame = filter_frame;
af_channels_t *s = af->priv;
MP_WARN(af, "This filter is deprecated (no replacement).\n");
// If router scan commandline for routing pairs
if(s->routes && s->routes[0]){
char* cp = s->routes;

View File

@ -188,6 +188,7 @@ static int filter(struct af_instance* af, struct mp_audio* data)
// Allocate memory and set function pointers
static int af_open(struct af_instance* af){
MP_WARN(af, "This filter is deprecated. Use 'anequalizer' or 'firequalizer' instead.\n");
af->control=control;
af->filter_frame = filter;
af_equalizer_t *priv = af->priv;

View File

@ -180,6 +180,7 @@ static int af_open(struct af_instance *af)
{
af->control = control;
af->filter_frame = filter_frame;
MP_WARN(af, "This filter is deprecated. Use lavfi pan instead.\n");
af_pan_t *s = af->priv;
int nch = s->nch;
if (nch && AF_OK != control(af, AF_CONTROL_SET_PAN_NOUT, &nch))

View File

@ -42,6 +42,7 @@ struct priv {
int fast; // Use fix-point volume control
int detach; // Detach if gain volume is neutral
float cfg_volume;
int warn;
};
// Convert to gain value from dB. input <= -200dB will become 0 gain.
@ -160,6 +161,8 @@ static int filter(struct af_instance *af, struct mp_audio *data)
static int af_open(struct af_instance *af)
{
struct priv *s = af->priv;
if (s->warn)
MP_WARN(af, "This filter is deprecated. Use --volume directly.\n");
af->control = control;
af->filter_frame = filter;
s->level = 1.0;
@ -184,6 +187,7 @@ const struct af_info af_info_volume = {
OPT_FLAG("softclip", soft, 0),
OPT_FLAG("s16", fast, 0),
OPT_FLAG("detach", detach, 0),
OPT_FLAG("warn", warn, 0, OPTDEF_INT(1)),
{0}
},
};

View File

@ -135,7 +135,8 @@ void audio_update_volume(struct MPContext *mpctx)
if (gain == 1.0)
return;
MP_VERBOSE(mpctx, "Inserting volume filter.\n");
if (!(af_add(ao_c->af, "volume", "softvol", NULL)
char *args[] = {"warn", "no", NULL};
if (!(af_add(ao_c->af, "volume", "softvol", args)
&& af_control_any_rev(ao_c->af, AF_CONTROL_SET_VOLUME, &gain)))
MP_ERR(mpctx, "No volume control available.\n");
}