Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiph/speex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-07-29 02:54:42 +0400
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2007-07-29 02:54:42 +0400
commit9e8a797da3327305d595246720dab41c192a929e (patch)
tree3c5b88f8b71660da16ad51145b144c18dfb29465 /src
parente41fb92039521a26eaa45ea86420c8e8e416491b (diff)
Windows patch to speexenc/speexdec by Alexander Chemeris
git-svn-id: http://svn.xiph.org/trunk/speex@13383 0101bb08-14d6-0310-b084-bc0e0c8e3800
Diffstat (limited to 'src')
-rw-r--r--src/speexdec.c11
-rw-r--r--src/speexenc.c15
2 files changed, 17 insertions, 9 deletions
diff --git a/src/speexdec.c b/src/speexdec.c
index 5835313..b8252b5 100644
--- a/src/speexdec.c
+++ b/src/speexdec.c
@@ -48,8 +48,6 @@
#include <ogg/ogg.h>
#if defined WIN32 || defined _WIN32
-#include <windows.h>
-#include "getopt_win.h"
#include "wave_out.h"
/* We need the following two to set stdout to binary */
#include <io.h>
@@ -84,7 +82,6 @@
#include <speex/speex_header.h>
#include <speex/speex_stereo.h>
#include <speex/speex_callbacks.h>
-#include "wav_io.h"
#define MAX_FRAME_SIZE 2000
@@ -289,13 +286,17 @@ void usage()
void version()
{
- printf ("speexdec (Speex decoder) version " SPEEX_VERSION " (compiled " __DATE__ ")\n");
+ const char* speex_version;
+ speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version);
+ printf ("speexdec (Speex decoder) version %s (compiled " __DATE__ ")\n", speex_version);
printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n");
}
void version_short()
{
- printf ("speexdec version " SPEEX_VERSION "\n");
+ const char* speex_version;
+ speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version);
+ printf ("speexdec version %s\n", speex_version);
printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n");
}
diff --git a/src/speexenc.c b/src/speexenc.c
index 37fd68b..52f7117 100644
--- a/src/speexenc.c
+++ b/src/speexenc.c
@@ -53,7 +53,6 @@
#include <speex/speex_preprocess.h>
#if defined WIN32 || defined _WIN32
-#include "getopt_win.h"
/* We need the following two to set stdout to binary */
#include <io.h>
#include <fcntl.h>
@@ -182,13 +181,17 @@ void add_fisbone_packet (ogg_stream_state *os, spx_int32_t serialno, SpeexHeader
void version()
{
- printf ("speexenc (Speex encoder) version " SPEEX_VERSION " (compiled " __DATE__ ")\n");
+ const char* speex_version;
+ speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version);
+ printf ("speexenc (Speex encoder) version %s (compiled " __DATE__ ")\n", speex_version);
printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n");
}
void version_short()
{
- printf ("speexenc version " SPEEX_VERSION "\n");
+ const char* speex_version;
+ speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version);
+ printf ("speexenc version %s\n", speex_version);
printf ("Copyright (C) 2002-2006 Jean-Marc Valin\n");
}
@@ -316,7 +319,8 @@ int main(int argc, char **argv)
SpeexHeader header;
int nframes=1;
spx_int32_t complexity=3;
- char *vendor_string = "Encoded with Speex " SPEEX_VERSION;
+ const char* speex_version;
+ char vendor_string[64];
char *comments;
int comments_length;
int close_in=0, close_out=0;
@@ -329,6 +333,9 @@ int main(int argc, char **argv)
SpeexPreprocessState *preprocess = NULL;
int denoise_enabled=0, agc_enabled=0;
spx_int32_t lookahead = 0;
+
+ speex_lib_ctl(SPEEX_LIB_GET_VERSION_STRING, (void*)&speex_version);
+ snprintf(vendor_string, sizeof(vendor_string), "Encoded with Speex %s", speex_version);
comment_init(&comments, &comments_length, vendor_string);