* [PATCH] audio/sdl2: fix unrecognized audio format
[not found] <20200120024422.GA686.ref@PC-SEANJYE>
@ 2020-01-20 2:44 ` KJ Liew
0 siblings, 0 replies; only message in thread
From: KJ Liew @ 2020-01-20 2:44 UTC (permalink / raw)
To: qemu-devel
On Windows/SDL2, SDL_OpenAudio() may obtain audio format different from
requested format.
QEMU trace:
sdl: sdl_open: req.fmt = 0x8010 obt.fmt = 0x8120
sdl: Unrecognized SDL audio format 33056
sdl: SDL_OpenAudio failed
The easiest fix is to force audio format conversion internal to SDL2.
diff -ru ../orig/qemu-4.2.0/audio/sdlaudio.c ../qemu-4.2.0/audio/sdlaudio.c
--- ../orig/qemu-4.2.0/audio/sdlaudio.c 2019-12-12 10:20:47.000000000 -0800
+++ ../qemu-4.2.0/audio/sdlaudio.c 2020-01-15 15:56:25.059841600 -0800
@@ -147,10 +147,11 @@
}
#endif
- status = SDL_OpenAudio (req, obt);
+ status = SDL_OpenAudio (req, NULL);
if (status) {
sdl_logerr ("SDL_OpenAudio failed\n");
}
+ memcpy(obt, req, sizeof(SDL_AudioSpec));
#ifndef _WIN32
err = pthread_sigmask (SIG_SETMASK, &old, NULL);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-20 2:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200120024422.GA686.ref@PC-SEANJYE>
2020-01-20 2:44 ` [PATCH] audio/sdl2: fix unrecognized audio format KJ Liew
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).