[Scummvm-cvs-logs] CVS: scummvm sdl.cpp,1.122,1.123 x11.cpp,1.27,1.28
Lionel Ulmer
bbrox at users.sourceforge.net
Sat May 18 07:54:02 CEST 2002
Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv19658
Modified Files:
sdl.cpp x11.cpp
Log Message:
Added infrastructure to support more than 8 bit signed / unsigned RAW
mixers. Porters, beware, the default configuration is now 16 bit
stereo instead of 16 mono as before (I changed X11 and SDL but no
others).
I did not add support for any other format yet, I will let Endy do it
when he needs it :-)
Index: sdl.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sdl.cpp,v
retrieving revision 1.122
retrieving revision 1.123
diff -u -d -r1.122 -r1.123
--- sdl.cpp 14 May 2002 19:38:28 -0000 1.122
+++ sdl.cpp 18 May 2002 14:53:18 -0000 1.123
@@ -829,7 +829,7 @@
desired.freq = SAMPLES_PER_SEC;
desired.format = AUDIO_S16SYS;
- desired.channels = 1;
+ desired.channels = 2;
desired.samples = 2048;
desired.callback = proc;
desired.userdata = param;
Index: x11.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/x11.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- x11.cpp 14 May 2002 21:23:41 -0000 1.27
+++ x11.cpp 18 May 2002 14:53:19 -0000 1.28
@@ -256,21 +256,18 @@
sched_yield();
while (1) {
- unsigned short *buf = (unsigned short *)sound_buffer;
+ unsigned char *buf = (unsigned char *)sound_buffer;
int size, written;
- sound_proc(proc_param, (byte *)sound_buffer, FRAG_SIZE >> 1);
- /* Now convert to stereo */
- for (int i = ((FRAG_SIZE >> 2) - 1); i >= 0; i--) {
- buf[2 * i + 1] = buf[2 * i] = buf[i];
- }
+ sound_proc(proc_param, (byte *)sound_buffer, FRAG_SIZE);
#ifdef CAPTURE_SOUND
fwrite(buf, 2, FRAG_SIZE >> 1, f);
fflush(f);
#endif
size = FRAG_SIZE;
while (size > 0) {
- written = write(sound_fd, sound_buffer, size);
+ written = write(sound_fd, buf, size);
+ buf += written;
size -= written;
}
}
More information about the Scummvm-git-logs
mailing list