1
0
mirror of https://github.com/mpv-player/mpv synced 2025-04-01 23:00:41 +00:00

af_lavrresample: minor simplification

The in/out pointers usually have not much meaning outside of
AF_CONTROL_REINIT. Also remove the redundant casts.
This commit is contained in:
wm4 2015-04-12 18:04:48 +02:00
parent f8a98fc133
commit ab2a27ae01

View File

@ -264,12 +264,12 @@ static int configure_lavrr(struct af_instance *af, struct mp_audio *in,
static int control(struct af_instance *af, int cmd, void *arg)
{
struct af_resample *s = (struct af_resample *) af->priv;
struct mp_audio *in = (struct mp_audio *) arg;
struct mp_audio *out = (struct mp_audio *) af->data;
struct af_resample *s = af->priv;
switch (cmd) {
case AF_CONTROL_REINIT: {
struct mp_audio *in = arg;
struct mp_audio *out = af->data;
struct mp_audio orig_in = *in;
if (((out->rate == in->rate) || (out->rate == 0)) &&
@ -310,7 +310,7 @@ static int control(struct af_instance *af, int cmd, void *arg)
return AF_OK;
}
case AF_CONTROL_SET_RESAMPLE_RATE:
out->rate = *(int *)arg;
af->data->rate = *(int *)arg;
return AF_OK;
case AF_CONTROL_SET_PLAYBACK_SPEED_RESAMPLE: {
s->playback_speed = *(double *)arg;