summaryrefslogtreecommitdiff
path: root/thirdparty/opus/internal.c
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2016-10-12 20:37:38 +0200
committerRémi Verschelde <rverschelde@gmail.com>2016-10-15 11:50:40 +0200
commitd9a291f6411f2e571c181da0ac89f550ba73f681 (patch)
treea560b8263d9ab896a05087eb20d5eeefdeb89969 /thirdparty/opus/internal.c
parentee3cf211c6fd4d1e30617467cdbbe945798a68b3 (diff)
ogg/vorbis/opus: Make them modules and unbundle thirdparty libs
Took the opportunity to undo the Godot changed made to the opus source. The opus module should eventually be built in its own environment to avoid polluting others with too many include dirs and defines. TODO: Fix the platform/ stuff for opus.
Diffstat (limited to 'thirdparty/opus/internal.c')
-rw-r--r--thirdparty/opus/internal.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/thirdparty/opus/internal.c b/thirdparty/opus/internal.c
new file mode 100644
index 0000000000..96c80def82
--- /dev/null
+++ b/thirdparty/opus/internal.c
@@ -0,0 +1,42 @@
+/********************************************************************
+ * *
+ * THIS FILE IS PART OF THE libopusfile SOFTWARE CODEC SOURCE CODE. *
+ * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS *
+ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
+ * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
+ * *
+ * THE libopusfile SOURCE CODE IS (C) COPYRIGHT 2012 *
+ * by the Xiph.Org Foundation and contributors http://www.xiph.org/ *
+ * *
+ ********************************************************************/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "internal.h"
+
+#if defined(OP_ENABLE_ASSERTIONS)
+void op_fatal_impl(const char *_str,const char *_file,int _line){
+ fprintf(stderr,"Fatal (internal) error in %s, line %i: %s\n",
+ _file,_line,_str);
+ abort();
+}
+#endif
+
+/*A version of strncasecmp() that is guaranteed to only ignore the case of
+ ASCII characters.*/
+int op_strncasecmp(const char *_a,const char *_b,int _n){
+ int i;
+ for(i=0;i<_n;i++){
+ int a;
+ int b;
+ int d;
+ a=_a[i];
+ b=_b[i];
+ if(a>='a'&&a<='z')a-='a'-'A';
+ if(b>='a'&&b<='z')b-='a'-'A';
+ d=a-b;
+ if(d)return d;
+ }
+ return 0;
+}