[MPlayer-dev-eng] [PATCH] New commands for loading/unloading audio filters at runtime

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Apr 3 19:42:16 CEST 2010


On Sun, Apr 04, 2010 at 01:49:54AM +0900, Jehan Pagès wrote:
> +            af_uninit ((&mpctx->mixer)->afilter);

mpctx->mixer.afilter
is the right syntax for that.

> +                af_add ((&mpctx->mixer)->afilter, af_command);
> +                af_command = strsep (&af_commands, ",");

Also please don't put a space before the ( of the function call.

> +    case MP_CMD_AF_ADD:
> +        if (!sh_audio)
> +            break;
> +        {
> +            char* af_args = strdup(cmd->args[0].v.s);
> +            char* af_commands = af_args;
> +            char* af_command = strsep (&af_commands, ",");
> +            while (af_command != NULL)
> +            {
> +                af_add ((&mpctx->mixer)->afilter, af_command);
> +                af_command = strsep (&af_commands, ",");
> +            }
> +            build_afilter_chain(sh_audio, &ao_data);
> +            free (af_args);
> +        }

Hm, this boiler-plate code is always the same and it's not performance-critical.
Maybe you could do a switch inside the while and this avoid duplicating
any code?
Without having reviewed it in details it looks fairly good otherwise.



More information about the MPlayer-dev-eng mailing list