From 5594718b6bda3a230e2e2c3cb06d2837c5a02688 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 18 Nov 2013 14:16:08 +0100 Subject: audio/filter: remove unneeded AF_CONTROLs, convert to enum The AF control commands used an elaborate and unnecessary organization for the command constants. Get rid of all that and convert the definitions to a simple enum. Also remove the control commands that were not really needed, because they were not used outside of the filters that implemented them. --- audio/filter/af.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'audio/filter/af.c') diff --git a/audio/filter/af.c b/audio/filter/af.c index 03e85245e0..6f0241ec2b 100644 --- a/audio/filter/af.c +++ b/audio/filter/af.c @@ -438,7 +438,7 @@ static int af_fix_format_conversion(struct af_stream *s, if (!filter) return AF_ERROR; if (strcmp(filter, prev->info->name) == 0) { - if (prev->control(prev, AF_CONTROL_FORMAT_FMT, &dstfmt) == AF_OK) { + if (prev->control(prev, AF_CONTROL_SET_FORMAT, &dstfmt) == AF_OK) { *p_af = prev; return AF_OK; } @@ -447,7 +447,7 @@ static int af_fix_format_conversion(struct af_stream *s, if (new == NULL) return AF_ERROR; new->auto_inserted = true; - if (AF_OK != (rv = new->control(new, AF_CONTROL_FORMAT_FMT, &dstfmt))) + if (AF_OK != (rv = new->control(new, AF_CONTROL_SET_FORMAT, &dstfmt))) return rv; *p_af = new; return AF_OK; @@ -463,7 +463,7 @@ static int af_fix_channels(struct af_stream *s, struct af_instance **p_af, struct mp_audio actual = *prev->data; if (mp_chmap_equals(&actual.channels, &in.channels)) return AF_FALSE; - if (prev->control(prev, AF_CONTROL_CHANNELS, &in.channels) == AF_OK) { + if (prev->control(prev, AF_CONTROL_SET_CHANNELS, &in.channels) == AF_OK) { *p_af = prev; return AF_OK; } @@ -472,7 +472,7 @@ static int af_fix_channels(struct af_stream *s, struct af_instance **p_af, if (new == NULL) return AF_ERROR; new->auto_inserted = true; - if (AF_OK != (rv = new->control(new, AF_CONTROL_CHANNELS, &in.channels))) + if (AF_OK != (rv = new->control(new, AF_CONTROL_SET_CHANNELS, &in.channels))) return rv; *p_af = new; return AF_OK; @@ -487,7 +487,7 @@ static int af_fix_rate(struct af_stream *s, struct af_instance **p_af, struct mp_audio actual = *prev->data; if (actual.rate == in.rate) return AF_FALSE; - if (prev->control(prev, AF_CONTROL_RESAMPLE_RATE, &in.rate) == AF_OK) { + if (prev->control(prev, AF_CONTROL_SET_RESAMPLE_RATE, &in.rate) == AF_OK) { *p_af = prev; return AF_OK; } @@ -496,7 +496,7 @@ static int af_fix_rate(struct af_stream *s, struct af_instance **p_af, if (new == NULL) return AF_ERROR; new->auto_inserted = true; - if (AF_OK != (rv = new->control(new, AF_CONTROL_RESAMPLE_RATE, &in.rate))) + if (AF_OK != (rv = new->control(new, AF_CONTROL_SET_RESAMPLE_RATE, &in.rate))) return rv; *p_af = new; return AF_OK; -- cgit v1.2.3