[FFmpeg-devel] Using a codec-private AVOption in init()?

Philip Langdale philipl at overt.org
Sat Apr 16 19:05:08 CEST 2011


 This one's got me quite confused. As far as I can tell, it's
 impossible to use an AVOption value in a codec's init function.

 av_opt_set_string3() and friends need to be passed the codec
 private context and will use the AVOption to discover the offset
 inside the context to write the value.

 However, the context isn't initialised until you call avcodec_open()
 which also calls the codec's init function before returning.

 Yet, there are multiple existing codecs that use AVOptions and use
 those values in init() (eg: vorbis, openamr-nb). Am I missing something
 or is this just broken?

 --phil


More information about the ffmpeg-devel mailing list