Merge commit 'ba8efac977f4276f05274947b2b67d144cbc965a'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 11 Apr 2013 00:03:31 +0000 (02:03 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 11 Apr 2013 00:10:12 +0000 (02:10 +0200)
* commit 'ba8efac977f4276f05274947b2b67d144cbc965a':
  af_channelmap: switch to an AVOptions-based system.

Conflicts:
doc/filters.texi
libavfilter/af_channelmap.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
doc/filters.texi
libavfilter/af_channelmap.c
libavfilter/avfilter.c

@@@ -1222,14 -324,14 +1222,14 @@@ output channels preserving index
  
  For example, assuming a 5.1+downmix input MOV file
  @example
- ffmpeg -i in.mov -filter 'channelmap=map=DL-FL\,DR-FR' out.wav
 -avconv -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
++ffmpeg -i in.mov -filter 'channelmap=map=DL-FL|DR-FR' out.wav
  @end example
  will create an output WAV file tagged as stereo from the downmix channels of
  the input.
  
  To fix a 5.1 WAV improperly encoded in AAC's native channel order
  @example
- ffmpeg -i in.wav -filter 'channelmap=1\,2\,0\,5\,3\,4:channel_layout=5.1' out.wav
 -avconv -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
++ffmpeg -i in.wav -filter 'channelmap=1|2|0|5|3|4:channel_layout=5.1' out.wav
  @end example
  
  @section join
@@@ -123,8 -122,8 +123,8 @@@ static int get_channel(char **map, uint
  static av_cold int channelmap_init(AVFilterContext *ctx, const char *args)
  {
      ChannelMapContext *s = ctx->priv;
--    int ret;
-     char *mapping;
++    int ret = 0;
+     char *mapping, separator = '|';
      int map_entries = 0;
      char buf[256];
      enum MappingMode mode;
@@@ -655,88 -479,8 +655,89 @@@ int avfilter_init_filter(AVFilterContex
      AVDictionary *options = NULL;
      AVDictionaryEntry *e;
      int ret=0;
 +    int anton_options =
 +        !strcmp(filter->filter->name,  "afade"     ) ||
 +        !strcmp(filter->filter->name,  "aformat") ||
 +        !strcmp(filter->filter->name,  "amix"      ) ||
 +        !strcmp(filter->filter->name,  "apad"      ) ||
 +        !strcmp(filter->filter->name,  "aphaser"   ) ||
 +        !strcmp(filter->filter->name,  "ass")     ||
 +        !strcmp(filter->filter->name,  "asyncts"   ) ||
 +        !strcmp(filter->filter->name,  "blackframe") ||
 +        !strcmp(filter->filter->name,  "blend"     ) ||
 +        !strcmp(filter->filter->name,  "boxblur"   ) ||
 +        !strcmp(filter->filter->name,  "cellauto") ||
++        !strcmp(filter->filter->name,  "channelmap") ||
 +        !strcmp(filter->filter->name,  "colormatrix") ||
 +        !strcmp(filter->filter->name,  "crop"      ) ||
 +        !strcmp(filter->filter->name,  "cropdetect") ||
 +        !strcmp(filter->filter->name,  "curves"    ) ||
 +        !strcmp(filter->filter->name,  "decimate"  ) ||
 +        !strcmp(filter->filter->name,  "delogo"    ) ||
 +        !strcmp(filter->filter->name,  "drawbox"   ) ||
 +        !strcmp(filter->filter->name,  "drawtext"  ) ||
 +        !strcmp(filter->filter->name,  "ebur128"   ) ||
 +        !strcmp(filter->filter->name,  "edgedetect") ||
 +        !strcmp(filter->filter->name,  "fade"      ) ||
 +        !strcmp(filter->filter->name,  "field"     ) ||
 +        !strcmp(filter->filter->name,  "fieldorder") ||
 +        !strcmp(filter->filter->name,  "fps"       ) ||
 +        !strcmp(filter->filter->name,  "frei0r"    ) ||
 +        !strcmp(filter->filter->name,  "frei0r_src") ||
 +        !strcmp(filter->filter->name,  "geq"       ) ||
 +        !strcmp(filter->filter->name, "gradfun"    ) ||
 +        !strcmp(filter->filter->name, "histeq"     ) ||
 +        !strcmp(filter->filter->name, "histogram"  ) ||
 +        !strcmp(filter->filter->name, "hqdn3d"     ) ||
 +        !strcmp(filter->filter->name, "idet"       ) ||
 +        !strcmp(filter->filter->name,  "il"        ) ||
 +        !strcmp(filter->filter->name,  "kerndeint" ) ||
 +        !strcmp(filter->filter->name, "ocv"        ) ||
 +        !strcmp(filter->filter->name, "life"       ) ||
 +        !strcmp(filter->filter->name, "lut"        ) ||
 +        !strcmp(filter->filter->name, "lutyuv"     ) ||
 +        !strcmp(filter->filter->name, "lutrgb"     ) ||
 +        !strcmp(filter->filter->name, "mandelbrot" ) ||
 +        !strcmp(filter->filter->name, "mptestsrc"  ) ||
 +        !strcmp(filter->filter->name, "negate"     ) ||
 +        !strcmp(filter->filter->name, "noise"      ) ||
 +        !strcmp(filter->filter->name, "overlay"    ) ||
 +        !strcmp(filter->filter->name, "pad"        ) ||
 +        !strcmp(filter->filter->name,   "format") ||
 +        !strcmp(filter->filter->name, "noformat") ||
 +        !strcmp(filter->filter->name, "perms")  ||
 +        !strcmp(filter->filter->name, "pp"   )  ||
 +        !strcmp(filter->filter->name, "aperms") ||
 +        !strcmp(filter->filter->name, "resample") ||
 +        !strcmp(filter->filter->name, "setpts"       ) ||
 +        !strcmp(filter->filter->name, "settb"        ) ||
 +        !strcmp(filter->filter->name, "showspectrum") ||
 +        !strcmp(filter->filter->name, "silencedetect") ||
 +        !strcmp(filter->filter->name, "smartblur") ||
 +        !strcmp(filter->filter->name, "stereo3d" ) ||
 +        !strcmp(filter->filter->name, "subtitles") ||
 +        !strcmp(filter->filter->name, "thumbnail") ||
 +        !strcmp(filter->filter->name, "transpose") ||
 +        !strcmp(filter->filter->name, "unsharp"  ) ||
 +//         !strcmp(filter->filter->name, "scale"      ) ||
 +        !strcmp(filter->filter->name, "select") ||
 +        !strcmp(filter->filter->name, "yadif"    ) ||
 +        0
 +        ;
 +
 +    if (filter->filter->shorthand) {
 +        av_assert0(filter->priv);
 +        av_assert0(filter->filter->priv_class);
 +        *(const AVClass **)filter->priv = filter->filter->priv_class;
 +        av_opt_set_defaults(filter->priv);
 +        ret = av_opt_set_from_string(filter->priv, args,
 +                                     filter->filter->shorthand, "=", ":");
 +        if (ret < 0)
 +            return ret;
 +        args = NULL;
 +    }
  
 -    if (args && *args && filter->filter->priv_class) {
 +    if (anton_options && args && *args && filter->filter->priv_class) {
  #if FF_API_OLD_FILTER_OPTS
          if (!strcmp(filter->filter->name, "scale") &&
              strchr(args, ':') < strchr(args, '=')) {