Add init and uninit functions to cmdutils, reduces code duplication

between ffmpeg and ffplay and avoids a valgrind error by freeing
avformat_opts->key.

Originally committed as revision 25309 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Reimar Döffinger
2010-10-02 08:44:33 +00:00
parent 05931ab763
commit a5c33faacc
4 changed files with 35 additions and 23 deletions

View File

@ -44,6 +44,17 @@ extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
extern AVFormatContext *avformat_opts;
extern struct SwsContext *sws_opts;
/**
* Initialize the cmdutils option system, in particular
* allocate the *_opts contexts.
*/
void init_opts(void);
/**
* Uninitialize the cmdutils option system, in particular
* free the *_opts contexts and their contents.
*/
void uninit_opts(void);
/**
* Trivial log callback.
* Only suitable for show_help and similar since it lacks prefix handling.