From 7c59d819a7ebb936d51ca032e66a2489e4080d08 Mon Sep 17 00:00:00 2001 From: George Marques Date: Sun, 1 May 2016 12:48:46 -0300 Subject: Update Opus driver to 1.1.2 And opusfile to 0.7. --- drivers/opus/celt/stack_alloc.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'drivers/opus/celt/stack_alloc.h') diff --git a/drivers/opus/celt/stack_alloc.h b/drivers/opus/celt/stack_alloc.h index 464a6d0b7f..7cd6c56ccf 100644 --- a/drivers/opus/celt/stack_alloc.h +++ b/drivers/opus/celt/stack_alloc.h @@ -36,21 +36,17 @@ #include "opus/opus_defines.h" #if (!defined (VAR_ARRAYS) && !defined (USE_ALLOCA) && !defined (NONTHREADSAFE_PSEUDOSTACK)) -#define VAR_ARRAYS +#error "Opus requires one of VAR_ARRAYS, USE_ALLOCA, or NONTHREADSAFE_PSEUDOSTACK be defined to select the temporary allocation mode." #endif #ifdef USE_ALLOCA # ifdef WIN32 # include # else -# ifdef OPUS_HAVE_ALLOCA_H +# ifdef HAVE_ALLOCA_H # include # else -# ifdef __linux__ -# include -# else -# include -# endif +# include # endif # endif #endif @@ -120,9 +116,11 @@ #else #ifdef CELT_C +char *scratch_ptr=0; char *global_stack=0; #else extern char *global_stack; +extern char *scratch_ptr; #endif /* CELT_C */ #ifdef ENABLE_VALGRIND @@ -144,8 +142,12 @@ extern char *global_stack_top; #define ALIGN(stack, size) ((stack) += ((size) - (long)(stack)) & ((size) - 1)) #define PUSH(stack, size, type) (ALIGN((stack),sizeof(type)/sizeof(char)),(stack)+=(size)*(sizeof(type)/sizeof(char)),(type*)((stack)-(size)*(sizeof(type)/sizeof(char)))) +#if 0 /* Set this to 1 to instrument pseudostack usage */ +#define RESTORE_STACK (printf("%ld %s:%d\n", global_stack-scratch_ptr, __FILE__, __LINE__),global_stack = _saved_stack) +#else #define RESTORE_STACK (global_stack = _saved_stack) -#define ALLOC_STACK char *_saved_stack; (global_stack = (global_stack==0) ? opus_alloc_scratch(GLOBAL_STACK_SIZE) : global_stack); _saved_stack = global_stack; +#endif +#define ALLOC_STACK char *_saved_stack; (global_stack = (global_stack==0) ? (scratch_ptr=opus_alloc_scratch(GLOBAL_STACK_SIZE)) : global_stack); _saved_stack = global_stack; #endif /* ENABLE_VALGRIND */ -- cgit v1.2.3