summaryrefslogtreecommitdiffstats
path: root/apps/codecs/libwavpack/wputils.c
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-05-17 06:32:49 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-05-17 06:32:49 +0000
commit6705a8834725a675a11494aa6966c145646e655c (patch)
tree4845fe39bfedcc1161cb14ab26933380271dc353 /apps/codecs/libwavpack/wputils.c
parentfe1ce9d8426899d4c254a161955762a33e6fcf25 (diff)
downloadrockbox-6705a8834725a675a11494aa6966c145646e655c.tar.gz
rockbox-6705a8834725a675a11494aa6966c145646e655c.zip
Patch #1203309 by David Bryant - WavPack codec fix and performance enhancement
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6481 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libwavpack/wputils.c')
-rw-r--r--apps/codecs/libwavpack/wputils.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/codecs/libwavpack/wputils.c b/apps/codecs/libwavpack/wputils.c
index 1b8fae0e67..9227b66e46 100644
--- a/apps/codecs/libwavpack/wputils.c
+++ b/apps/codecs/libwavpack/wputils.c
@@ -19,6 +19,8 @@
#include <string.h>
+static void strcpy_loc (char *dst, char *src) { while (*src) *dst++ = *src++; *dst = 0; }
+
///////////////////////////// local table storage ////////////////////////////
const ulong sample_rates [] = { 6000, 8000, 9600, 11025, 12000, 16000, 22050,
@@ -49,7 +51,6 @@ WavpackContext *WavpackOpenFileInput (read_stream infile, char *error)
{
WavpackStream *wps = &wpc.stream;
ulong bcount;
- (void)error;
CLEAR (wpc);
wpc.infile = infile;
@@ -64,12 +65,12 @@ WavpackContext *WavpackOpenFileInput (read_stream infile, char *error)
bcount = read_next_header (wpc.infile, &wps->wphdr);
if (bcount == (ulong) -1) {
- /*strcpy (error, "not compatible with this version of WavPack file!");*/
+ strcpy_loc (error, "invalid WavPack file!");
return NULL;
}
if ((wps->wphdr.flags & UNKNOWN_FLAGS) || wps->wphdr.version < 0x402 || wps->wphdr.version > 0x40f) {
- /*strcpy (error, "not compatible with this version of WavPack file!");*/
+ strcpy_loc (error, "invalid WavPack file!");
return NULL;
}
@@ -77,8 +78,8 @@ WavpackContext *WavpackOpenFileInput (read_stream infile, char *error)
wpc.total_samples = wps->wphdr.total_samples;
if (!unpack_init (&wpc)) {
- /*strcpy (error, wpc.error_message [0] ? wpc.error_message :
- "not compatible with this version of WavPack file!");*/
+ strcpy_loc (error, wpc.error_message [0] ? wpc.error_message :
+ "invalid WavPack file!");
return NULL;
}
@@ -170,7 +171,7 @@ ulong WavpackUnpackSamples (WavpackContext *wpc, long *buffer, ulong samples)
break;
if (wps->wphdr.version < 0x402 || wps->wphdr.version > 0x40f) {
- /*strcpy (wpc->error_message, "not compatible with this version of WavPack file!");*/
+ strcpy_loc (wpc->error_message, "invalid WavPack file!");
break;
}