diff options
Diffstat (limited to 'audio/filter/af_sinesuppress.c')
-rw-r--r-- | audio/filter/af_sinesuppress.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/audio/filter/af_sinesuppress.c b/audio/filter/af_sinesuppress.c index 36f7189f00..10f0b650ec 100644 --- a/audio/filter/af_sinesuppress.c +++ b/audio/filter/af_sinesuppress.c @@ -54,8 +54,8 @@ static int control(struct af_instance* af, int cmd, void* arg) // Sanity check if(!arg) return AF_ERROR; - af->data->rate = ((struct mp_audio*)arg)->rate; - af->data->nch = 1; + mp_audio_copy_config(af->data, (struct mp_audio*)arg); + mp_audio_set_num_channels(af->data, 1); #if 0 if (((struct mp_audio*)arg)->format == AF_FORMAT_FLOAT_NE) { @@ -65,8 +65,7 @@ static int control(struct af_instance* af, int cmd, void* arg) }// else #endif { - af->data->format = AF_FORMAT_S16_NE; - af->data->bps = 2; + mp_audio_set_format(af->data, AF_FORMAT_S16_NE); af->play = play_s16; } @@ -79,18 +78,6 @@ static int control(struct af_instance* af, int cmd, void* arg) s->decay = f2; return AF_OK; } - case AF_CONTROL_SS_FREQ | AF_CONTROL_SET: - s->freq = *(float*)arg; - return AF_OK; - case AF_CONTROL_SS_FREQ | AF_CONTROL_GET: - *(float*)arg = s->freq; - return AF_OK; - case AF_CONTROL_SS_DECAY | AF_CONTROL_SET: - s->decay = *(float*)arg; - return AF_OK; - case AF_CONTROL_SS_DECAY | AF_CONTROL_GET: - *(float*)arg = s->decay; - return AF_OK; } return AF_UNKNOWN; } |