sf#3167852 - sdl sound still popping - patch applied
works for me (tested with kid icarus).. waiting for results (its always been fine on my machine; i use ossv4)
This commit is contained in:
parent
f62f565026
commit
a0b2915c68
|
@ -55,9 +55,13 @@ fillaudio(void *udata,
|
||||||
//printf("s_BufferIn: %i s_BufferWrite = %i s_BufferRead = %i s_BufferSize = %i\n",
|
//printf("s_BufferIn: %i s_BufferWrite = %i s_BufferRead = %i s_BufferSize = %i\n",
|
||||||
// s_BufferIn, s_BufferWrite, s_BufferRead, s_BufferSize);
|
// s_BufferIn, s_BufferWrite, s_BufferRead, s_BufferSize);
|
||||||
|
|
||||||
// ensure that we're not writing garbage data to the soundcard
|
/* XXX RDJ: WTF? This doesn't make any sense at all. This will ensure that garbage data *does*
|
||||||
if(s_BufferWrite > s_BufferRead)
|
make it to the sound card, both in theory (it breaks the idea of a ring buffer) and in practice
|
||||||
s_BufferWrite = s_BufferRead;
|
(I get all sorts of pops, snaps, and garbled noise on my machine with these lines in place).
|
||||||
|
// ensure that we're not writing garbage data to the soundcard
|
||||||
|
if(s_BufferWrite > s_BufferRead)
|
||||||
|
s_BufferWrite = s_BufferRead;
|
||||||
|
*/
|
||||||
|
|
||||||
while(len) {
|
while(len) {
|
||||||
int16 sample = 0;
|
int16 sample = 0;
|
||||||
|
@ -187,7 +191,11 @@ WriteSound(int32 *buf,
|
||||||
s_Buffer[s_BufferWrite] = *buf;
|
s_Buffer[s_BufferWrite] = *buf;
|
||||||
Count--;
|
Count--;
|
||||||
s_BufferWrite = (s_BufferWrite + 1) % s_BufferSize;
|
s_BufferWrite = (s_BufferWrite + 1) % s_BufferSize;
|
||||||
|
|
||||||
|
SDL_LockAudio();
|
||||||
s_BufferIn++;
|
s_BufferIn++;
|
||||||
|
SDL_UnlockAudio();
|
||||||
|
|
||||||
buf++;
|
buf++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue