summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@naxine.org>2002-04-01 13:24:47 +0000
committerMichael Niedermayer <michaelni@gmx.at>2002-04-01 13:24:47 +0000
commit0344cd0a7cc91e49637b85221a61aede8e9bd888 (patch)
treeb75950aa8b28ea1208b5f505718f3eb5aafbcbcd /libavcodec
parentff3dfbae1a74864841d0f9b8951ccf6b1013a7ae (diff)
multiple init bugfix (patch by Alex Beregszaszi <alex@naxine.org>)
Originally committed as revision 371 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utils.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 406966c729..d3244dfff3 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -385,12 +385,24 @@ int avpicture_get_size(int pix_fmt, int width, int height)
/* must be called before any other functions */
void avcodec_init(void)
{
+ static int inited = 0;
+
+ if (inited != 0)
+ return;
+ inited = 1;
+
dsputil_init();
}
/* simple call to use all the codecs */
void avcodec_register_all(void)
{
+ static int inited = 0;
+
+ if (inited != 0)
+ return;
+ inited = 1;
+
/* encoders */
#ifdef CONFIG_ENCODERS
register_avcodec(&ac3_encoder);