Skip to content
Snippets Groups Projects
Commit 4506d0fa authored by deuce's avatar deuce
Browse files

Fix previous commit.

parent e8472670
No related branches found
No related tags found
No related merge requests found
......@@ -124,13 +124,6 @@ ifdef USE_SDL_AUDIO
endif
endif
ifndef NO_PULSEAUDIO
ifeq ($(shell command -v pkg-config > /dev/null && pkg-config --exists libpulse && echo 'YES' ; fi),YES)
XPDEV_CFLAGS += -DWITH_PULSEAUDIO
XPDEV_MT_CFLAGS += -DWITH_PULSEAUDIO
endif
endif
ifdef STATIC
STATIC_SDL := true
endif
......
......@@ -8,6 +8,13 @@ ifneq ($(os),win32)
MTOBJS += $(MTOBJODIR)$(DIRSEP)xpevent$(OFILE)
endif
ifndef NO_PULSEAUDIO
ifeq ($(shell command -v pkg-config > /dev/null && pkg-config --exists libpulse && echo 'YES'),YES)
CFLAGS += -DWITH_PULSEAUDIO `pkg-config libpulse --cflags`
MT_CFLAGS += -DWITH_PULSEAUDIO `pkg-config libpulse --cflags`
endif
endif
CFLAGS += -DSOUNDCARD_H_IN=$(shell if [ -f /usr/include/sys/soundcard.h ] ; then echo 1 ; elif [ -f /usr/include/soundcard.h ] ; then echo 2 ; elif [ -f /usr/include/linux/soundcard.h ] ; then echo 3 ; else echo 0 ; fi) -I. $(XPDEV_CFLAGS)
ifndef WITHOUT_ALSA_SOUND
ifeq ($(shell if [ -f /usr/include/alsa/asoundlib.h ] ; then echo YES ; fi),YES)
......
......@@ -110,12 +110,13 @@ static int handle_rc;
#ifdef WITH_PULSEAUDIO
struct pulseaudio_api_struct {
pa_simple* (*simple_new)(const char * server, const char * name, pa_stream_direction_t dir, const char * dev, const char * stream_name, const pa_sample_spec * ss, const pa_channel_map * map, const pa_buffer_attr * attr, int * error);
int (*simple_write)(simple * s, const void * data, size_t bytes, int * error);
int (*simple_write)(pa_simple * s, const void * data, size_t bytes, int * error);
int (*simple_drain)(pa_simple * s, int * error);
void (*simple_free)(pa_simple * s);
};
struct pulseaudio_api_struct pu_api = NULL;
struct pulseaudio_api_struct *pu_api = NULL;
static pa_simple *pu_handle;
static int pulseaudio_initialized=FALSE;
#endif
#ifdef WITH_PORTAUDIO
......@@ -394,7 +395,7 @@ DLLCALL xptone_open_locked(void)
|| ((pu_api->simple_new=xp_dlsym(dl,pa_simple_new))==NULL)
|| ((pu_api->simple_write=xp_dlsym(dl,pa_simple_write))==NULL)
|| ((pu_api->simple_drain=xp_dlsym(dl,pa_simple_drain))==NULL)
|| ((pu_api->simple_fre=xp_dlsym(dl,pa_simple_free))==NULL)
|| ((pu_api->simple_free=xp_dlsym(dl,pa_simple_free))==NULL)
) {
if(dl)
xp_dlclose(dl);
......@@ -661,9 +662,9 @@ xptone_complete_locked(void)
}
#ifdef WITH_PULSEAUDIO
else if (handle->type == SOUND_DEVICE_PULSEAUDIO) {
else if (handle_type == SOUND_DEVICE_PULSEAUDIO) {
int err;
pu_api.simple_drain(pu_handle, &err);
pu_api->simple_drain(pu_handle, &err);
}
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment