Opened 5 years ago

Closed 5 years ago

#3924 closed defect (invalid)

libavcodec - the option name "ac" is duplicated

Reported by: cnt Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

What I do:
I am trying to list AVOptions of libavcodec in a GUI interface.
I need to have a unique key for each AVOption. I thought it was possible with the name of the option...

My problem:
There are two options with the same name "ac". This option could be the number of audio channels, or the arithmetic coder.

Content of libavcodec/options_tables.h:

...
{"ac", "set number of audio channels", OFFSET(channels), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|D|E},
...
{"ac", "arithmetic coder", 0, AV_OPT_TYPE_CONST, {.i64 = FF_CODER_TYPE_AC }, INT_MIN, INT_MAX, V|E, "coder"},
...

Change History (4)

comment:1 Changed 5 years ago by cnt

  • Summary changed from libavcodec - option name "ac" is duplicated to libavcodec - the option name "ac" is duplicated

comment:2 Changed 5 years ago by cehoyos

  • Analyzed by developer unset
  • Keywords ac removed
  • Reproduced by developer unset

I don't think there are two options with the name ac.
There is one option -ac with sets the number of audio channels, for example -ac 2 and there is an option -coder that allows to select Huffman or arithmetic coder, for example with -coder ac. How can these options be confused?

comment:3 Changed 5 years ago by cnt

The command line is fine.

But to list AVOptions on my GUI application, I use av_opt_next function. This function returns two options with the same name : "ac".
If I look at the file libavcodec/options_tables.h, I see two AVOptions which correpond to "ac":

  • one with the help : "set number of audio channels".
  • the other one with the help : "arithmetic coder".

comment:4 Changed 5 years ago by michael

  • Resolution set to invalid
  • Status changed from new to closed

Theres one option and one constant.
If you want to make a list of options that can be set to somevalue or another then your gui would skip constants (AV_OPT_TYPE_CONST). These are not options the user could set to something

If you want to make a list of value that a single option can be set to then you would only consider all AV_OPT_TYPE_CONST which had a matching unit to the specific option

Note: See TracTickets for help on using tickets.