add oss audio to retrofw (#13303)

Co-authored-by: Poligraf <>
This commit is contained in:
Poligraf 2021-12-02 05:19:39 +13:00 committed by GitHub
parent 621c3a7b7e
commit b4ef32cfce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -111,10 +111,7 @@ HAVE_CHEATS = 1
HAVE_CHEEVOS = 0
HAVE_LIBSHAKE = 0
HAVE_CORE_INFO_CACHE = 1
#comment out for now not working
#HAVE_OSS =1
#HAVE_OSS_LIB =1
HAVE_OSS =1
OS = Linux
TARGET = retroarch
@ -139,6 +136,7 @@ DEFINES := -DRARCH_INTERNAL -D_FILE_OFFSET_BITS=64 -UHAVE_STATIC_DUMMY
DEFINES += -DHAVE_C99=1 -DHAVE_CXX=1
DEFINES += -DHAVE_GETOPT_LONG=1 -DHAVE_STRCASESTR=1 -DHAVE_DYNAMIC=1
DEFINES += -DHAVE_FILTERS_BUILTIN
DEFINES += -DHAVE_OSS=1
SDL_DINGUX_CFLAGS := $(shell $(GCW0_SDL_CONFIG) --cflags)
SDL_DINGUX_LIBS := $(shell $(GCW0_SDL_CONFIG) --libs)

View File

@ -126,8 +126,10 @@ static bool oss_stop(void *data)
{
oss_audio_t *ossaudio = (oss_audio_t*)data;
#if !defined(RETROFW)
if (ioctl(ossaudio->fd, SNDCTL_DSP_RESET, 0) < 0)
return false;
#endif
ossaudio->is_paused = true;
return true;
@ -167,8 +169,11 @@ static void oss_free(void *data)
{
oss_audio_t *ossaudio = (oss_audio_t*)data;
/*RETROFW IOCTL always returns EINVAL*/
#if !defined(RETROFW)
if (ioctl(ossaudio->fd, SNDCTL_DSP_RESET, 0) < 0)
return;
#endif
close(ossaudio->fd);
free(data);