comparison 3x666.c @ 22:c57df9d21007

Kludge to work.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 15 Mar 2013 20:52:42 +0200
parents 19fccd4a7404
children 7c314ac342f4
comparison
equal deleted inserted replaced
21:19fccd4a7404 22:c57df9d21007
579 579
580 // The audio rendering handling is a bit silly due to the way 580 // The audio rendering handling is a bit silly due to the way
581 // the original code works (assumes that it can always render 581 // the original code works (assumes that it can always render
582 // a certain amount/duration of data, instead of being given 582 // a certain amount/duration of data, instead of being given
583 // the buffer duration/size to render. So we cope with that here. 583 // the buffer duration/size to render. So we cope with that here.
584 while (engine.mixFill < need && engine.mixFill < engine.mixBufSize) 584 while (engine.mixFill < need && engine.mixFill < engine.mixBufSize / 2)
585 { 585 {
586 int got = engineRenderAudio(engine.mixBuf + engine.mixFill); 586 int got = engineRenderAudio(engine.mixBuf + engine.mixFill);
587 engine.mixFill += got; 587 engine.mixFill += got;
588 } 588 }
589 589
958 958
959 engine.tickLen = engine.optAfmt.freq / SET_DEMOHZ; 959 engine.tickLen = engine.optAfmt.freq / SET_DEMOHZ;
960 audio_precalcs(); 960 audio_precalcs();
961 setpal(); 961 setpal();
962 962
963 engine.mixBufSize = (16 + SET_MAXROWLGT) * sizeof(Sint32); 963 engine.mixBufSize = (1024 + SET_MAXROWLGT) * sizeof(Sint32);
964 engine.mixBuf = malloc(engine.mixBufSize); 964 engine.mixBuf = malloc(engine.mixBufSize);
965 965
966 // Start audio, enter main loop 966 // Start audio, enter main loop
967 dmPrint("We are go.\n"); 967 dmPrint("We are go.\n");
968 SDL_LockAudio(); 968 SDL_LockAudio();