[xiph-commits] r13383 - trunk/speex/src

jm at svn.xiph.org jm at svn.xiph.org
Sat Jul 28 15:54:42 PDT 2007


Author: jm
Date: 2007-07-28 15:54:42 -0700 (Sat, 28 Jul 2007)
New Revision: 13383

Modified:
   trunk/speex/src/speexdec.c
   trunk/speex/src/speexenc.c
Log:
Windows patch to speexenc/speexdec by Alexander Chemeris


Modified: trunk/speex/src/speexdec.c
===================================================================
--- trunk/speex/src/speexdec.c	2007-07-28 22:54:34 UTC (rev 13382)
+++ trunk/speex/src/speexdec.c	2007-07-28 22:54:42 UTC (rev 13383)
@@ -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 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");
 }
 

Modified: trunk/speex/src/speexenc.c
===================================================================
--- trunk/speex/src/speexenc.c	2007-07-28 22:54:34 UTC (rev 13382)
+++ trunk/speex/src/speexenc.c	2007-07-28 22:54:42 UTC (rev 13383)
@@ -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 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 @@
    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 @@
    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);
 



More information about the commits mailing list