Opened 7 years ago

Closed 7 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


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 by cnt, 7 years ago

Summary: libavcodec - option name "ac" is duplicatedlibavcodec - the option name "ac" is duplicated

comment:2 by Carl Eugen Hoyos, 7 years ago

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 by cnt, 7 years ago

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 by Michael Niedermayer, 7 years ago

Resolution: invalid
Status: newclosed

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.