# HG changeset patch # User michaelni # Date 1017667487 0 # Node ID 9a931fd8d06caa4be2550603fad1314053a0f10e # Parent 826b179dad50045f70ab30a48ac9155282878ef5 multiple init bugfix (patch by Alex Beregszaszi ) diff -r 826b179dad50 -r 9a931fd8d06c utils.c --- a/utils.c Sat Mar 30 21:33:14 2002 +0000 +++ b/utils.c Mon Apr 01 13:24:47 2002 +0000 @@ -385,12 +385,24 @@ /* 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);