[FFmpeg-devel] [PATCHv2] avfilter: add anoisesrc
Paul B Mahol
onemda at gmail.com
Thu Nov 5 21:43:47 CET 2015
On 11/5/15, Nicolas George <george at nsup.org> wrote:
> Le quintidi 15 brumaire, an CCXXIV, Kyle Swanson a ecrit :
>> + { "color", "set noise color", OFFSET(color),
>> AV_OPT_TYPE_STRING, {.str = "white"}, CHAR_MIN, CHAR_MAX, FLAGS },
>
>> + if (!strcmp(s->color, "pink")) {
>> + s->filter = pink_filter;
>> + } else if(!strcmp(s->color, "brown")) {
>> + s->filter = brown_filter;
>> + } else if(!strcmp(s->color, "white")) {
>> + s->filter = white_filter;
>> + } else {
>> + av_log(ctx, AV_LOG_ERROR, "Invalid noise color: %s\n",
>> s->color);
>> + return AVERROR_OPTION_NOT_FOUND;
>> + }
>
> Did you miss the part where I suggested to use AV_OPT_TYPE_FLAG for this?
> It
> is really much better than reimplementing the parsing.
Hmm, why not simple enum/int?
More information about the ffmpeg-devel
mailing list