From 7a961a46ba28e49f88ff0e81b96395c96b424634 Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 14 Dec 2008 20:04:00 +0000 Subject: [PATCH] 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 --- libavcodec/avcodec.h | 2 +- libavcodec/utils.c | 1 + libavformat/allformats.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index ffc08f50e6..048d225844 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -31,7 +31,7 @@ #define LIBAVCODEC_VERSION_MAJOR 52 #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, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 755af1ac62..713a4c298a 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -90,6 +90,7 @@ AVCodec *av_codec_next(AVCodec *c){ void register_avcodec(AVCodec *codec) { AVCodec **p; + avcodec_init(); p = &first_avcodec; while (*p != NULL) p = &(*p)->next; *p = codec; diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 986e0f07da..43243f8062 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -50,7 +50,6 @@ void av_register_all(void) return; initialized = 1; - avcodec_init(); avcodec_register_all(); /* (de)muxers */