Mercurial > libavcodec.hg
changeset 303:9a931fd8d06c libavcodec
multiple init bugfix (patch by Alex Beregszaszi <alex@naxine.org>)
author | michaelni |
---|---|
date | Mon, 01 Apr 2002 13:24:47 +0000 |
parents | 826b179dad50 |
children | 5753d57e7e6b |
files | utils.c |
diffstat | 1 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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);