[SCM] libav/experimental: multiple init bugfix (patch by Alex Beregszaszi <alex at naxine.org>)

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 15:31:18 UTC 2013


The following commit has been merged in the experimental branch:
commit 0344cd0a7cc91e49637b85221a61aede8e9bd888
Author: Alex Beregszaszi <alex at naxine.org>
Date:   Mon Apr 1 13:24:47 2002 +0000

    multiple init bugfix (patch by Alex Beregszaszi <alex at naxine.org>)
    
    Originally committed as revision 371 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 406966c..d3244df 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);

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list