[Audacity-devel] [doug@jekyl.ddts.net: Bug#140417: audacity: Fails to read several formats on Alpha]
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
|
From: Joshua H. <jha...@up...> - 2002-03-29 03:39:01
|
How does this fix look to you all? Any reason not to apply it?
I'm wondering specifically if the "int32_t" type is portable to Mac and
Windows?
Joshua
----- Forwarded message from Doug Larrick <do...@je...> -----
Date: Thu, 28 Mar 2002 22:20:16 -0500
From: Doug Larrick <do...@je...>
To: Debian Bug Tracking System <su...@bu...>
Subject: Bug#140417: audacity: Fails to read several formats on Alpha
X-Mailer: reportbug 1.49
Package: audacity
Version: 0.98-2
Severity: normal
Tags: patch
Audacity fails to read several file formats, including WAV, AIFF, and NEXT,
on Alpha, and presumably on other 64-bit platforms.
The root cause is the assumption in the import code that a 'long' is a 32-bit
quantity. The attached patch uses 'int32_t' instead in a few crucial
locations.
diff -ru audacity-0.98/snd/sndhead.h audacity-0.98-dcl/snd/sndhead.h
--- audacity-0.98/snd/sndhead.h Tue Jan 22 01:14:15 2002
+++ audacity-0.98-dcl/snd/sndhead.h Thu Mar 28 18:39:02 2002
@@ -1,7 +1,7 @@
/* sndhead.h -- header info */
/* NeXT sound headers */
-#define NEXT_SND_MAGIC (*((long *) ".snd")) // was: ((int)0x2e736e64)
+#define NEXT_SND_MAGIC (*((int32_t *) ".snd")) // was: ((int)0x2e736e64)
#define NEXT_SND_FORMAT_UNSPECIFIED (0)
#define NEXT_SND_FORMAT_ULAW_8 (1)
#define NEXT_SND_FORMAT_LINEAR_8 (2)
diff -ru audacity-0.98/snd/sndheader.c audacity-0.98-dcl/snd/sndheader.c
--- audacity-0.98/snd/sndheader.c Tue Jan 22 01:14:15 2002
+++ audacity-0.98-dcl/snd/sndheader.c Thu Mar 28 22:15:58 2002
@@ -138,8 +138,9 @@
long readlong(int file, long *read_in)
{
+ // Really 32-bit
long l = 0;
- readitem(file, &l, long);
+ readitem(file, &l, int32_t);
return ntohl(l);
}
@@ -375,8 +376,8 @@
}
-#define AIFF_SND_MAGIC (*((long *) "FORM"))
-#define WAVE_SND_MAGIC (*((long *) "RIFF"))
+#define AIFF_SND_MAGIC (*((int32_t *) "FORM"))
+#define WAVE_SND_MAGIC (*((int32_t *) "RIFF"))
long snd_read_header(snd_type snd, long *flags)
{
-- System Information
Debian Release: 3.0
Architecture: alpha
Kernel: Linux jekyl 2.4.17 #1 Sat Jan 5 13:13:45 EST 2002 alpha
Locale: LANG=C, LC_CTYPE=
Versions of packages audacity depends on:
ii libc6.1 2.2.5-3 GNU C Library: Shared libraries an
ii libglib1.2 1.2.10-4 The GLib library of C routines
ii libgtk1.2 1.2.10-10 The GIMP Toolkit set of widgets fo
ii libid3-3.7-13 3.7.13-4.1 Library for manipulating ID3v1 and
ii libjpeg62 6b-5 The Independent JPEG Group's JPEG
ii libmad0 0.14.2b-2 MPEG audio decoder library
ii libogg0 1.0rc3-1 Ogg Bitstream Library
ii libpng2 1.0.12-3 PNG library - runtime
ii libstdc++2.10-glibc2.2 1:2.95.4-5 The GNU stdc++ library
ii libtiff3g 3.5.5-6 Tag Image File Format library
ii libvorbis0 1.0rc3-1 The Vorbis General Audio Compressi
ii libwxgtk2.2 2.2.9.2 wxWindows Cross-platform C++ GUI t
ii xlibs 4.1.0-14 X Window System client libraries
ii zlib1g 1:1.1.4-1 compression library - runtime
----- End forwarded message -----
--
Joshua Haberman <jo...@ha...>
|