The string given by an AVOption that contains the channel assignment
is used only once; ergo it doesn't matter that parsing the string via
av_strtok() is destructive. There is no need to make a copy.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
static void parse_map(AVFilterContext *ctx)
{
HeadphoneContext *s = ctx->priv;
- char *arg, *tokenizer, *p, *args = av_strdup(s->map);
+ char *arg, *tokenizer, *p;
uint64_t used_channels = 0;
- if (!args)
- return;
- p = args;
-
s->lfe_channel = -1;
s->nb_inputs = 1;
+ p = s->map;
while ((arg = av_strtok(p, "|", &tokenizer))) {
uint64_t out_channel;
s->nb_inputs = 2;
else
s->nb_inputs = s->nb_irs + 1;
-
- av_free(args);
}
typedef struct ThreadData {