Version 0.1.12 from FTP
[asterisk/asterisk.git] / codecs / codec_g723_1.c
index cbc2e63..1d65555 100755 (executable)
@@ -23,6 +23,7 @@
 #include <asterisk/translate.h>
 #include <asterisk/module.h>
 #include <asterisk/logger.h>
+#include <asterisk/channel.h>
 #include <pthread.h>
 #include <fcntl.h>
 #include <stdlib.h>
@@ -53,7 +54,7 @@
 #include "slin_g723_ex.h"
 #include "g723_slin_ex.h"
 
-static pthread_mutex_t localuser_lock = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t localuser_lock = AST_MUTEX_INITIALIZER;
 static int localusecnt=0;
 
 #ifdef ANNEX_B
@@ -357,13 +358,13 @@ static struct ast_translator lintog723 =
 int unload_module(void)
 {
        int res;
-       pthread_mutex_lock(&localuser_lock);
+       ast_pthread_mutex_lock(&localuser_lock);
        res = ast_unregister_translator(&lintog723);
        if (!res)
                res = ast_unregister_translator(&g723tolin);
        if (localusecnt)
                res = -1;
-       pthread_mutex_unlock(&localuser_lock);
+       ast_pthread_mutex_unlock(&localuser_lock);
        return res;
 }