Remove callback from cosmoaudio API

Using callbacks is still problematic with cosmo_dlopen() due to the need
to restore the TLS register. So using callbacks is even more strict than
using signal handlers. We are better off introducing a cosmoaudio_poll()
function. It makes the API more UNIX-like. How bad could the latency be?
This commit is contained in:
Justine Tunney 2024-09-07 17:42:15 -07:00
parent d99f066114
commit d50d954a3c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
17 changed files with 433 additions and 158 deletions

View file

@ -40,6 +40,7 @@
#include "libc/calls/ucontext.h"
#include "libc/ctype.h"
#include "libc/cxxabi.h"
#include "libc/dce.h"
#include "libc/errno.h"
#include "libc/fmt/conv.h"
#include "libc/fmt/itoa.h"
@ -56,7 +57,9 @@
#include "libc/nexgen32e/bench.h"
#include "libc/nexgen32e/x86feature.h"
#include "libc/nt/console.h"
#include "libc/nt/enum/threadpriority.h"
#include "libc/nt/runtime.h"
#include "libc/nt/thread.h"
#include "libc/runtime/runtime.h"
#include "libc/sock/sock.h"
#include "libc/sock/struct/pollfd.h"
@ -1398,6 +1401,10 @@ static void TryToOpenFrameBuffer(void) {
int main(int argc, char *argv[]) {
sigset_t wut;
ShowCrashReports();
#ifdef __x86_64__
if (IsWindows())
SetThreadPriority(GetCurrentThread(), kNtThreadPriorityHighest);
#endif
gamma_ = 2.4;
volscale_ = 1.f;
dither_ = true;