diff 3x666.c @ 25:f896fe6a98da

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 15 Mar 2013 23:35:52 +0200
parents 7c314ac342f4
children 7f7330567277
line wrap: on
line diff
--- a/3x666.c	Fri Mar 15 23:21:08 2013 +0200
+++ b/3x666.c	Fri Mar 15 23:35:52 2013 +0200
@@ -584,11 +584,15 @@
     // capable of producing stereo anyway (for now, at least.)
     int i, need = len / sizeof(Sint16);
 
+#if 0
     // The audio rendering handling is a bit silly due to the way
     // the original code works (assumes that it can always render
     // a certain amount/duration of data, instead of being given
     // the buffer duration/size to render. So we cope with that here.
-    while (engine.mixFill < need && engine.mixFill < engine.mixBufSize / 2)
+    if (need >= engine.mixBufSize)
+        need = engine.mixBufSize;
+    
+    while (engine.mixFill < need && engine.mixFill < engine.mixBufSize)
     {
         int got = engineRenderAudio(engine.mixBuf + engine.mixFill);
         engine.mixFill += got;
@@ -604,6 +608,7 @@
     {
         memmove(engine.mixBuf, engine.mixBuf + need, engine.mixFill * sizeof(Sint32));
     }
+#endif
 }