[xiph-commits] r7058 - trunk/speex/libspeex

jm at dactyl.lonelymoon.com jm
Thu Jul 8 21:28:08 PDT 2004


Author: jm
Date: Thu Jul  8 21:28:08 2004
New Revision: 7058

Modified:
trunk/speex/libspeex/misc.h
trunk/speex/libspeex/speex.c
trunk/speex/libspeex/speex.h
trunk/speex/libspeex/speex_header.c
Log:
run-time calls for identifying the Speex version


Modified: trunk/speex/libspeex/misc.h
===================================================================
--- trunk/speex/libspeex/misc.h	2004-07-08 21:46:15 UTC (rev 7057)
+++ trunk/speex/libspeex/misc.h	2004-07-09 04:28:06 UTC (rev 7058)
@@ -35,8 +35,8 @@
#ifndef MISC_H
#define MISC_H

-#ifndef VERSION
-#define VERSION "speex-1.1.6"
+#ifndef SPEEX_VERSION
+#define SPEEX_VERSION "speex-1.1.6"
#endif

#include "arch.h"

Modified: trunk/speex/libspeex/speex.c
===================================================================
--- trunk/speex/libspeex/speex.c	2004-07-08 21:46:15 UTC (rev 7057)
+++ trunk/speex/libspeex/speex.c	2004-07-09 04:28:06 UTC (rev 7058)
@@ -237,23 +237,32 @@
switch (request)
{
case SPEEX_LIB_GET_MAJOR_VERSION:
+         *((int*)ptr) = SPEEX_MAJOR_VERSION;
break;
case SPEEX_LIB_GET_MINOR_VERSION:
+         *((int*)ptr) = SPEEX_MINOR_VERSION;
break;
case SPEEX_LIB_GET_MICRO_VERSION:
+         *((int*)ptr) = SPEEX_MICRO_VERSION;
break;
case SPEEX_LIB_GET_EXTRA_VERSION:
+         *((char**)ptr) = SPEEX_EXTRA_VERSION;
break;
case SPEEX_LIB_GET_VERSION_STRING:
+         *((char**)ptr) = SPEEX_VERSION;
break;
-      case SPEEX_LIB_SET_ALLOC_FUNC:
+      /*case SPEEX_LIB_SET_ALLOC_FUNC:
break;
case SPEEX_LIB_GET_ALLOC_FUNC:
break;
case SPEEX_LIB_SET_FREE_FUNC:
break;
case SPEEX_LIB_GET_FREE_FUNC:
+         break;*/
+      default:
+         speex_warning_int("Unknown wb_mode_query request: ", request);
+         return -1;
break;
}
-   return -1;
+   return 0;
}

Modified: trunk/speex/libspeex/speex.h
===================================================================
--- trunk/speex/libspeex/speex.h	2004-07-08 21:46:15 UTC (rev 7057)
+++ trunk/speex/libspeex/speex.h	2004-07-09 04:28:06 UTC (rev 7058)
@@ -171,7 +171,7 @@
#define SPEEX_LIB_GET_EXTRA_VERSION 7
#define SPEEX_LIB_GET_VERSION_STRING 9

-#define SPEEX_LIB_SET_ALLOC_FUNC 10
+/*#define SPEEX_LIB_SET_ALLOC_FUNC 10
#define SPEEX_LIB_GET_ALLOC_FUNC 11
#define SPEEX_LIB_SET_FREE_FUNC 12
#define SPEEX_LIB_GET_FREE_FUNC 13
@@ -180,8 +180,8 @@
#define SPEEX_LIB_GET_WARNING_FUNC 15
#define SPEEX_LIB_SET_ERROR_FUNC 16
#define SPEEX_LIB_GET_ERROR_FUNC 17
+*/

-
/** Number of defined modes in Speex */
#define SPEEX_NB_MODES 3


Modified: trunk/speex/libspeex/speex_header.c
===================================================================
--- trunk/speex/libspeex/speex_header.c	2004-07-08 21:46:15 UTC (rev 7057)
+++ trunk/speex/libspeex/speex_header.c	2004-07-09 04:28:06 UTC (rev 7058)
@@ -68,13 +68,13 @@
char *h="Speex   ";
/*
strncpy(header->speex_string, "Speex   ", 8);
-   strncpy(header->speex_version, VERSION, SPEEX_HEADER_VERSION_LENGTH-1);
+   strncpy(header->speex_version, SPEEX_VERSION, SPEEX_HEADER_VERSION_LENGTH-1);
header->speex_version[SPEEX_HEADER_VERSION_LENGTH-1]=0;
*/
for (i=0;i<8;i++)
header->speex_string[i]=h[i];
-   for (i=0;i<SPEEX_HEADER_VERSION_LENGTH-1 && VERSION[i];i++)
-      header->speex_version[i]=VERSION[i];
+   for (i=0;i<SPEEX_HEADER_VERSION_LENGTH-1 && SPEEX_VERSION[i];i++)
+      header->speex_version[i]=SPEEX_VERSION[i];
for (;i<SPEEX_HEADER_VERSION_LENGTH;i++)
header->speex_version[i]=0;




More information about the commits mailing list