All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arecord without timelimit produces buggy wav files.
@ 2002-12-18 14:45 Jordi Mallach
  2002-12-19 11:12 ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Jordi Mallach @ 2002-12-18 14:45 UTC (permalink / raw)
  To: alsa-devel; +Cc: stevenk, madkiss

[-- Attachment #1: Type: text/plain, Size: 1899 bytes --]

[resent with my subscriber address... is someone moderating alsa-devel?]

Hello,

Daniel Kobras reported a bug in arecord ages ago, against
beta10a. Quoting:

> When running arecord without timelimit (no -d option), the size of the
> RIFF chunk in a wav file is not updated when the recording is finished.
> The resulting wav causes trouble with some applications as the dummy
> chunk size is negative. (Chunk sizes are spec'ed as signed integer.
> Don't ask me why.) The following patch adds the proper fixup for the
> RIFF chunk. Patch against version 0.9.0beta10a-2 of alsa-utils.


--- aplay.c.orig	Sat Dec  1 21:26:46 2001
+++ aplay.c	Fri Feb  1 18:11:39 2002
@@ -1548,12 +1548,17 @@
 {				/* only close output */
 	WaveChunkHeader cd;
 	off_t length_seek;
+	u_int rifflen;
 	
 	length_seek = sizeof(WaveHeader) +
 		      sizeof(WaveChunkHeader) +
 		      sizeof(WaveFmtBody);
 	cd.type = WAV_DATA;
 	cd.length = LE_INT(fdcount);
+	rifflen = fdcount + 2*sizeof(WaveChunkHeader) + sizeof(WaveFmtBody) + 4;
+	rifflen = LE_INT(rifflen);
+	if (lseek(fd, 4, SEEK_SET) == 4)
+		write(fd, &rifflen, 4);
 	if (lseek(fd, length_seek, SEEK_SET) == length_seek)
 		write(fd, &cd, sizeof(WaveChunkHeader));
 	if (fd != 1)

The current Debian packages have this patch applied, and the full bug
log is in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=131875.

Thanks,
Jordi

PS: recently, new people started working on Debian's ALSA packages.
We'll try to forward all the bugs and patches that have piled up against
our packages in the previous era. What's the prefered way of reporting
bugs and problems against alsa packages components?
-- 
Jordi Mallach Pérez  --  Debian developer     http://www.debian.org/
jordi@sindominio.net     jordi@debian.org     http://www.sindominio.net/
GnuPG public key information available at http://oskuro.net/~jordi/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-12-19 17:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-18 14:45 [PATCH] arecord without timelimit produces buggy wav files Jordi Mallach
2002-12-19 11:12 ` Takashi Iwai
2002-12-19 11:35   ` Jordi Mallach
2002-12-19 12:06   ` bug-tracking system tomasz motylewski
2002-12-19 17:30     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.