add noglobals API support to speexdec.c
authorconrad <conrad@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Wed, 21 Jul 2004 06:34:37 +0000 (06:34 +0000)
committerconrad <conrad@0101bb08-14d6-0310-b084-bc0e0c8e3800>
Wed, 21 Jul 2004 06:34:37 +0000 (06:34 +0000)
git-svn-id: http://svn.xiph.org/trunk/speex@7208 0101bb08-14d6-0310-b084-bc0e0c8e3800

src/speexdec.c

index 479070a..f0a8982 100644 (file)
 #include <speex/speex_callbacks.h>
 #include "misc.h"
 
+#ifdef DISABLE_GLOBAL_POINTERS
+#include <speex/speex_noglobals.h>
+#endif
+
 #define MAX_FRAME_SIZE 2000
 
 #define readint(buf, base) (((buf[base+3]<<24)&0xff000000)| \
@@ -323,7 +327,12 @@ static void *process_header(ogg_packet *op, int enh_enabled, int *frame_size, in
    modeID = header->mode;
    if (forceMode!=-1)
       modeID = forceMode;
+
+#ifdef DISABLE_GLOBAL_POINTERS
+   mode = speex_mode_new (modeID);
+#else
    mode = speex_mode_list[modeID];
+#endif
    
    if (header->speex_version_id > 1)
    {