Commit 7a961a46 authored by Stefano Sabatini's avatar Stefano Sabatini

Make register_avcodec() call avcodec_init().

This avoids the possibility to use a registered codec without first
initializing libavcodec, which resulted in unexpected behavior.

Originally committed as revision 16131 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 335a761a
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define LIBAVCODEC_VERSION_MAJOR 52 #define LIBAVCODEC_VERSION_MAJOR 52
#define LIBAVCODEC_VERSION_MINOR 6 #define LIBAVCODEC_VERSION_MINOR 6
#define LIBAVCODEC_VERSION_MICRO 1 #define LIBAVCODEC_VERSION_MICRO 2
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \ LIBAVCODEC_VERSION_MINOR, \
......
...@@ -90,6 +90,7 @@ AVCodec *av_codec_next(AVCodec *c){ ...@@ -90,6 +90,7 @@ AVCodec *av_codec_next(AVCodec *c){
void register_avcodec(AVCodec *codec) void register_avcodec(AVCodec *codec)
{ {
AVCodec **p; AVCodec **p;
avcodec_init();
p = &first_avcodec; p = &first_avcodec;
while (*p != NULL) p = &(*p)->next; while (*p != NULL) p = &(*p)->next;
*p = codec; *p = codec;
......
...@@ -50,7 +50,6 @@ void av_register_all(void) ...@@ -50,7 +50,6 @@ void av_register_all(void)
return; return;
initialized = 1; initialized = 1;
avcodec_init();
avcodec_register_all(); avcodec_register_all();
/* (de)muxers */ /* (de)muxers */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment