Bug in aplay
Hi list,
aplay from the alsa-utils package has a small bug thatI had noticed for quite a while, but only last week I found the reason.
Situation: I often have e.g. a directory full of drum sounds as *.wav files and play them with "aplay *.wav". This used to work just fine a few versions ago, but recent versions only played part of a file, then jumped to the next file, and after a couple of files playback got even shorter again.
The bug was introduced between versions 0.9.0rc7 and 0.9.0rc8 and it seems as if the changes made then should clean up the source code a bit. In fact, previous versions were also somewhat broken, but the bug did not show there.
I have attached a one-line patch. Check out the variable "pbrec_count" (just named "count" in 0.9.0rc7) which was never reset to its initial value of -1 at the start of playback of a file when several files have to be played.
Greetings,
Frank
PS: Did noone ever notice this before? :-)
aplay.c renamed from aplay.c.orig +1 -0
@@ -528,6 +528,7 @@capture (NULL ); }else {while (optind <= argc -1 ) { + pbrec_count = (size_t )-1 ;if (stream ==SND_PCM_STREAM_PLAYBACK )playback (argv[optind++]);else