Update of /cvsroot/alsa/alsa-lib/src/pcm
In directory sc8-pr-cvs1:/tmp/cvs-serv21590
Modified Files:
pcm_dmix.c
Log Message:
A small cleanup to 32-bit mix routine as Abramo suggested
Index: pcm_dmix.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_dmix.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- pcm_dmix.c 19 Mar 2003 12:27:43 -0000 1.32
+++ pcm_dmix.c 19 Mar 2003 13:16:21 -0000 1.33
@@ -197,7 +197,7 @@
register signed int sample, old_sample;
while (size-- > 0) {
- sample = *src >> 8;
+ sample = *src / 256;
old_sample = *sum;
if (*dst == 0)
sample -= old_sample;
@@ -205,12 +205,12 @@
do {
old_sample = *sum;
if (old_sample > 0x7fffff)
- sample = 0x7fffff;
+ sample = 0x7fffffff;
else if (old_sample < -0x800000)
- sample = -0x800000;
+ sample = -0x80000000;
else
- sample = old_sample;
- *dst = sample << 8;
+ sample = old_sample * 256;
+ *dst = sample;
} while (*sum != old_sample);
((char *)src) += src_step;
((char *)dst) += dst_step;
@@ -709,7 +709,7 @@
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_avail(pcm);
+ avail = snd_pcm_mmap_playback_avail(pcm);
if (avail < 0)
return 0;
if (frames > (snd_pcm_uframes_t)avail)
-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink?
You could win a Tablet PC. Get a free Tablet PC hat just for playing.
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog