Updated SoX binary to v14.4.2-Final (2015-02-22), compiled with ICL 15.0 and MSVC 12.0.

This commit is contained in:
LoRd_MuldeR 2015-03-21 19:05:44 +01:00
parent 36a381dacd
commit 80995537c2
7 changed files with 479 additions and 5 deletions

View File

@ -82,10 +82,11 @@
<h2 id="lamexp-v4.11-2015-xx-xx" class="unnumbered">LameXP v4.11 [2015-xx-xx]</h2>
<ul>
<li>Upgraded build environment to Microsoft Visual Studio 2013 with Update-4<br /></li>
<li>Updated Qt runtime libraries to v4.8.7 snapshot-4 (2015-02-16), compiled with MSVC 12.0<br /></li>
<li>Starting with this version, LameXP is based on the <a href="http://sourceforge.net/p/mutilities/code/"><em>MUtilities</em></a> library + massive code clean-up<br /></li>
<li>Added support for the <a href="https://github.com/lordmulder/DynamicAudioNormalizer">DynamicAudioNormalizer</a> normalization filter<br /></li>
<li>Updated Qt runtime libraries to v4.8.7 snapshot-4 (2015-02-16), compiled with MSVC 12.0<br /></li>
<li>Updated MediaInfo to v0.7.72 (2015-01-07), compiled with ICL 15.0 and MSVC 12.0<br /></li>
<li>Updated SoX to v14.4.2-Git (2012-10-06), compiled with ICL 15.0 and MSVC 12.0<br /></li>
<li>Updated SoX to v14.4.2-Final (2015-02-22), compiled with ICL 15.0 and MSVC 12.0<br /></li>
<li>Updated Opus libraries to v1.1.x and Opus-Tools v0.1.9 to latest Git Master (2014-10-04)<br /></li>
<li>Updated mpg123 decoder to v1.22.0 (2015-02-24), compiled with GCC 4.9.2<br /></li>
<li>Updated Vorbis encoder to OggEnc v2.87 (2014-06-24), using libvorbis v1.3.4 and aoTuV b6.03_2014<br /></li>

View File

@ -5,10 +5,11 @@
## LameXP v4.11 [2015-xx-xx] ## {-}
* Upgraded build environment to Microsoft Visual Studio 2013 with Update-4
* Updated Qt runtime libraries to v4.8.7 snapshot-4 (2015-02-16), compiled with MSVC 12.0
* Starting with this version, LameXP is based on the [*MUtilities*](http://sourceforge.net/p/mutilities/code/) library + massive code clean-up
* Added support for the [DynamicAudioNormalizer](https://github.com/lordmulder/DynamicAudioNormalizer) normalization filter
* Updated Qt runtime libraries to v4.8.7 snapshot-4 (2015-02-16), compiled with MSVC 12.0
* Updated MediaInfo to v0.7.72 (2015-01-07), compiled with ICL 15.0 and MSVC 12.0
* Updated SoX to v14.4.2-Git (2012-10-06), compiled with ICL 15.0 and MSVC 12.0
* Updated SoX to v14.4.2-Final (2015-02-22), compiled with ICL 15.0 and MSVC 12.0
* Updated Opus libraries to v1.1.x and Opus-Tools v0.1.9 to latest Git Master (2014-10-04)
* Updated mpg123 decoder to v1.22.0 (2015-02-24), compiled with GCC 4.9.2
* Updated Vorbis encoder to OggEnc v2.87 (2014-06-24), using libvorbis v1.3.4 and aoTuV b6.03_2014

View File

@ -0,0 +1,15 @@
src/sox.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/sox.c b/src/sox.c
index ec1dffe..ebfaf60 100644
--- a/src/sox.c
+++ b/src/sox.c
@@ -1273,6 +1273,7 @@ static void display_status(sox_bool all_done)
}
if (all_done)
fputc('\n', stderr);
+ fflush(stderr);
}
#ifdef HAVE_TERMIOS_H

View File

@ -0,0 +1,457 @@
src/effects_i.c | 3 +-
src/formats.c | 9 ++-
src/libsox_i.c | 7 +-
src/noiseprof.c | 3 +-
src/sox.c | 30 ++++++--
src/unicode_support.c | 199 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/unicode_support.h | 46 ++++++++++++
7 files changed, 282 insertions(+), 15 deletions(-)
diff --git a/src/effects_i.c b/src/effects_i.c
index 685e962..deee444 100644
--- a/src/effects_i.c
+++ b/src/effects_i.c
@@ -20,6 +20,7 @@
#define LSX_EFF_ALIAS
#include "sox_i.h"
+#include "unicode_support.h"
#include <string.h>
#include <ctype.h>
@@ -463,7 +464,7 @@ FILE * lsx_open_input_file(sox_effect_t * effp, char const * filename, sox_bool
effp->global_info->global_info->stdin_in_use_by = effp->handler.name;
file = stdin;
}
- else if (!(file = fopen(filename, text_mode ? "r" : "rb"))) {
+ else if (!(file = lsx_fopen(filename, text_mode ? "r" : "rb"))) {
lsx_fail("couldn't open file %s: %s", filename, strerror(errno));
return NULL;
}
diff --git a/src/formats.c b/src/formats.c
index 724a4cd..a5b65d9 100644
--- a/src/formats.c
+++ b/src/formats.c
@@ -19,6 +19,7 @@
*/
#include "sox_i.h"
+#include "unicode_support.h"
#include <assert.h>
#include <ctype.h>
@@ -401,7 +402,7 @@ static FILE * xfopen(char const * identifier, char const * mode, lsx_io_type * i
#endif
return f;
}
- return fopen(identifier, mode);
+ return lsx_fopen(identifier, mode);
}
/* Hack to rewind pipes (a small amount).
@@ -853,8 +854,8 @@ static sox_format_t * open_write(
ft->fp = stdout;
}
else {
- struct stat st;
- if (!stat(path, &st) && (st.st_mode & S_IFMT) == S_IFREG &&
+ struct _stat st;
+ if (!lsx_stat(path, &st) && (st.st_mode & S_IFMT) == S_IFREG &&
(overwrite_permitted && !overwrite_permitted(path))) {
lsx_fail("permission to overwrite `%s' denied", path);
goto error;
@@ -864,7 +865,7 @@ static sox_format_t * open_write(
buffer? fmemopen(buffer, buffer_size, "w+b") :
buffer_ptr? open_memstream(buffer_ptr, buffer_size_ptr) :
#endif
- fopen(path, "w+b");
+ lsx_fopen(path, "w+b");
if (ft->fp == NULL) {
lsx_fail("can't open output file `%s': %s", path, strerror(errno));
goto error;
diff --git a/src/libsox_i.c b/src/libsox_i.c
index a5afb8e..f834136 100644
--- a/src/libsox_i.c
+++ b/src/libsox_i.c
@@ -20,6 +20,7 @@
#include "sox_i.h"
+#include "unicode_support.h"
#ifdef HAVE_IO_H
#include <io.h>
@@ -48,8 +49,8 @@
#ifdef WIN32
static int check_dir(char * buf, size_t buflen, char const * name)
{
- struct stat st;
- if (!name || stat(name, &st) || (st.st_mode & S_IFMT) != S_IFDIR)
+ struct _stat st;
+ if (!name || lsx_stat(name, &st) || (st.st_mode & S_IFMT) != S_IFDIR)
{
return 0;
}
@@ -102,7 +103,7 @@ FILE * lsx_tmpfile(void)
fildes = mkstemp(name);
#ifdef HAVE_UNISTD_H
lsx_debug(FAKE_MKSTEMP "mkstemp, name=%s (unlinked)", name);
- unlink(name);
+ lsx_unlink(name);
#else
lsx_debug(FAKE_MKSTEMP "mkstemp, name=%s (O_TEMPORARY)", name);
#endif
diff --git a/src/noiseprof.c b/src/noiseprof.c
index 8fe6d4f..fd798ca 100644
--- a/src/noiseprof.c
+++ b/src/noiseprof.c
@@ -19,6 +19,7 @@
*/
#include "noisered.h"
+#include "unicode_support.h"
#include <assert.h>
#include <string.h>
@@ -75,7 +76,7 @@ static int sox_noiseprof_start(sox_effect_t * effp)
effp->global_info->global_info->stdout_in_use_by = effp->handler.name;
data->output_file = stdout;
}
- else if ((data->output_file = fopen(data->output_filename, "wb")) == NULL) {
+ else if ((data->output_file = lsx_fopen(data->output_filename, "wb")) == NULL) {
lsx_fail("Couldn't open profile file %s: %s", data->output_filename, strerror(errno));
return SOX_EOF;
}
diff --git a/src/sox.c b/src/sox.c
index fcdac94..ec1dffe 100644
--- a/src/sox.c
+++ b/src/sox.c
@@ -24,6 +24,7 @@
#include "soxconfig.h"
#include "sox.h"
#include "util.h"
+#include "unicode_support.h"
#include <ctype.h>
#include <errno.h>
@@ -238,10 +239,10 @@ static void cleanup(void)
if (file_count) {
if (ofile->ft) {
if (!success && ofile->ft->io_type == lsx_io_file) { /* If we failed part way through */
- struct stat st; /* writing a normal file, remove it. */
- if (!stat(ofile->ft->filename, &st) &&
+ struct _stat st; /* writing a normal file, remove it. */
+ if (!lsx_stat(ofile->ft->filename, &st) &&
(st.st_mode & S_IFMT) == S_IFREG)
- unlink(ofile->ft->filename);
+ lsx_unlink(ofile->ft->filename);
}
sox_close(ofile->ft); /* Assume we can unlink a file before closing it. */
}
@@ -905,7 +906,7 @@ static char * * strtoargv(char * s, int * argc)
static void read_user_effects(char const *filename)
{
- FILE *file = fopen(filename, "r");
+ FILE *file = lsx_fopen(filename, "r");
const size_t buffer_size_step = 1024;
size_t buffer_size = buffer_size_step;
char *s = lsx_malloc(buffer_size); /* buffer for one input line */
@@ -2136,7 +2137,7 @@ static void read_comment_file(sox_comments_t * comments, char const * const file
int c;
size_t text_length = 100;
char * text = lsx_malloc(text_length + 1);
- FILE * file = fopen(filename, "r");
+ FILE * file = lsx_fopen(filename, "r");
if (file == NULL) {
lsx_fail("Cannot open comment file `%s'", filename);
@@ -2848,7 +2849,7 @@ static sox_bool cmp_comment_text(char const * c1, char const * c2)
return c1 && c2 && !strcasecmp(c1, c2);
}
-int main(int argc, char **argv)
+static int sox_main(int argc, char **argv)
{
size_t i;
char mybase[6];
@@ -3051,3 +3052,20 @@ int main(int argc, char **argv)
return 0;
}
+
+int main(int argc, char **argv)
+{
+ int sox_argc;
+ char **sox_argv;
+ int exit_code;
+
+ lsx_init_console();
+ lsx_init_commandline_arguments(&sox_argc, &sox_argv);
+
+ exit_code = sox_main(sox_argc, sox_argv);
+
+ lsx_uninit_console();
+ lsx_free_commandline_arguments(&sox_argc, &sox_argv);
+
+ return exit_code;
+}
diff --git a/src/unicode_support.c b/src/unicode_support.c
new file mode 100644
index 0000000..f89aa7b
--- /dev/null
+++ b/src/unicode_support.c
@@ -0,0 +1,199 @@
+/* Copyright (c) 2004-2015 LoRd_MuldeR <mulder2@gmx.de>
+ File: unicode_support.c
+
+ This file was originally part of a patch included with LameXP,
+ released under the same license as the original audio tools.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#if defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64
+
+#include "unicode_support.h"
+
+#include <windows.h>
+#include <io.h>
+
+static UINT g_old_output_cp = ((UINT)-1);
+
+static char *utf16_to_utf8(const wchar_t *input)
+{
+ char *Buffer;
+ int BuffSize = 0, Result = 0;
+
+ BuffSize = WideCharToMultiByte(CP_UTF8, 0, input, -1, NULL, 0, NULL, NULL);
+ Buffer = (char*) malloc(sizeof(char) * BuffSize);
+ if(Buffer)
+ {
+ Result = WideCharToMultiByte(CP_UTF8, 0, input, -1, Buffer, BuffSize, NULL, NULL);
+ }
+
+ return ((Result > 0) && (Result <= BuffSize)) ? Buffer : NULL;
+}
+
+static char *utf16_to_ansi(const wchar_t *input)
+{
+ char *Buffer;
+ int BuffSize = 0, Result = 0;
+
+ BuffSize = WideCharToMultiByte(CP_ACP, 0, input, -1, NULL, 0, NULL, NULL);
+ Buffer = (char*) malloc(sizeof(char) * BuffSize);
+ if(Buffer)
+ {
+ Result = WideCharToMultiByte(CP_ACP, 0, input, -1, Buffer, BuffSize, NULL, NULL);
+ }
+
+ return ((Result > 0) && (Result <= BuffSize)) ? Buffer : NULL;
+}
+
+static wchar_t *utf8_to_utf16(const char *input)
+{
+ wchar_t *Buffer;
+ int BuffSize = 0, Result = 0;
+
+ BuffSize = MultiByteToWideChar(CP_UTF8, 0, input, -1, NULL, 0);
+ Buffer = (wchar_t*) malloc(sizeof(wchar_t) * BuffSize);
+ if(Buffer)
+ {
+ Result = MultiByteToWideChar(CP_UTF8, 0, input, -1, Buffer, BuffSize);
+ }
+
+ return ((Result > 0) && (Result <= BuffSize)) ? Buffer : NULL;
+}
+
+void lsx_init_commandline_arguments(int *argc, char ***argv)
+{
+ int i, nArgs;
+ LPWSTR *szArglist;
+
+ szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
+
+ if(NULL == szArglist)
+ {
+ fprintf(stderr, "\nFATAL: CommandLineToArgvW failed\n\n");
+ exit(-1);
+ }
+
+ *argv = (char**) malloc(sizeof(char*) * nArgs);
+ *argc = nArgs;
+
+ if(NULL == *argv)
+ {
+ fprintf(stderr, "\nFATAL: Malloc failed\n\n");
+ exit(-1);
+ }
+
+ for(i = 0; i < nArgs; i++)
+ {
+ (*argv)[i] = utf16_to_utf8(szArglist[i]);
+ if(NULL == (*argv)[i])
+ {
+ fprintf(stderr, "\nFATAL: utf16_to_utf8 failed\n\n");
+ exit(-1);
+ }
+ }
+
+ LocalFree(szArglist);
+}
+
+void lsx_free_commandline_arguments(int *argc, char ***argv)
+{
+ int i = 0;
+
+ if(*argv != NULL)
+ {
+ for(i = 0; i < *argc; i++)
+ {
+ if((*argv)[i] != NULL)
+ {
+ free((*argv)[i]);
+ (*argv)[i] = NULL;
+ }
+ }
+ free(*argv);
+ *argv = NULL;
+ }
+}
+
+FILE *lsx_fopen(const char *filename_utf8, const char *mode_utf8)
+{
+ FILE *ret = NULL;
+ wchar_t *filename_utf16 = utf8_to_utf16(filename_utf8);
+ wchar_t *mode_utf16 = utf8_to_utf16(mode_utf8);
+
+ if(filename_utf16 && mode_utf16)
+ {
+ FILE *fh = NULL;
+ int err = _wfopen_s(&fh, filename_utf16, mode_utf16);
+ if(err == 0) ret = fh;
+ }
+
+ if(filename_utf16) free(filename_utf16);
+ if(mode_utf16) free(mode_utf16);
+
+ return ret;
+}
+
+int lsx_stat(const char *path_utf8, struct _stat *buf)
+{
+ int ret = -1;
+
+ wchar_t *path_utf16 = utf8_to_utf16(path_utf8);
+ if(path_utf16)
+ {
+ ret = _wstat(path_utf16, buf);
+ free(path_utf16);
+ }
+
+ return ret;
+}
+
+int lsx_unlink(const char *path_utf8)
+{
+ int ret = -1;
+
+ wchar_t *path_utf16 = utf8_to_utf16(path_utf8);
+ if(path_utf16)
+ {
+ ret = _wunlink(path_utf16);
+ free(path_utf16);
+ }
+
+ return ret;
+}
+
+void lsx_init_console(void)
+{
+ g_old_output_cp = GetConsoleOutputCP();
+ SetConsoleOutputCP(CP_UTF8);
+}
+
+void lsx_uninit_console(void)
+{
+ if(g_old_output_cp != ((UINT)-1))
+ {
+ SetConsoleOutputCP(g_old_output_cp);
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/src/unicode_support.h b/src/unicode_support.h
new file mode 100644
index 0000000..6abd0b3
--- /dev/null
+++ b/src/unicode_support.h
@@ -0,0 +1,46 @@
+/* Copyright (c) 2004-2015 LoRd_MuldeR <mulder2@gmx.de>
+ File: unicode_support.h
+
+ This file was originally part of a patch included with LameXP,
+ released under the same license as the original audio tools.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+#ifndef UNICODE_SUPPORT_H_INCLUDED
+#define UNICODE_SUPPORT_H_INCLUDED
+
+#include <stdio.h>
+#include <sys/stat.h>
+
+#define WIN_UNICODE 1
+
+void lsx_init_commandline_arguments(int *argc, char ***argv);
+void lsx_free_commandline_arguments(int *argc, char ***argv);
+FILE *lsx_fopen(const char *filename_utf8, const char *mode_utf8);
+int lsx_stat(const char *path_utf8, struct _stat *buf);
+int lsx_unlink(const char *path_utf8);
+void lsx_init_console(void);
+void lsx_uninit_console(void);
+
+#endif
\ No newline at end of file

Binary file not shown.

View File

@ -85,7 +85,7 @@ g_lamexp_tools[] =
{"704ff390fb14960a766b79aa35a7527a8417bc5e649f5330bb3cd2ad61d227fe26b5dd9190aac5f6789540a23da50f01", CPU_TYPE_ALL_SSE, "opusenc.sse2.exe", 20141005, "v1.1"},
{"bdfa8dec142b6327a33af6bb314d7beb924588d1b73f2ef3f46b31fa6046fe2f4e64ca78b025b7eb9290a78320e2aa57", CPU_TYPE_ALL_ALL, "refalac.exe", 56, ""},
{"d041b60de6c5c6e77cbad84440db57bbeb021af59dd0f7bebd3ede047d9e2ddc2a0c14179472687ba91063743d23e337", CPU_TYPE_ALL_ALL, "shorten.exe", 361, ""},
{"2e305f1a1c630ec9670de2f884a570d1424d08ffabcb4b6211371b76adbb2af66c308520e1a9674b1d20aecb3df32724", CPU_TYPE_ALL_ALL, "sox.exe", 1442, ""},
{"6e3f86cc464d84b0039139c9688e3097d0f42b794a5db10954d24fe77929585a0d0dba16cb677cc1b390392c39cdefad", CPU_TYPE_ALL_ALL, "sox.exe", 1442, ""},
{"5a4261e1b41a59d1a5bc92e1d2766422a67454d77e06ea29af392811b7b4704e0f3e494ab9cb6375ce9e39257867c5ed", CPU_TYPE_ALL_ALL, "speexdec.exe", 12, ""},
{"75d4c18dbb74e2dbf7342698428248d45cc4070d5f95da8831ef755e63dcd7ff9c3a760f289e8ef8b5c06b82548edbd8", CPU_TYPE_ALL_ALL, "tag.exe", 100, ""},
{"a83628880da0b7519ec368a74a92da5a5099d8d46aa0583131f92d7321f47c9e16a1841b2a3fb8ffcca7205ef4b1bb0a", CPU_TYPE_ALL_ALL, "tta.exe", 21, ""},