platform="generic"
builtin_gpu_list="peops unai neon"
builtin_gpu=""
-sound_driver_list="oss alsa sdl pulseaudio libretro"
+sound_driver_list="oss alsa pulseaudio sdl libretro"
sound_drivers=""
plugins="plugins/spunull/spunull.so \
plugins/dfxvideo/gpu_peops.so plugins/gpu_unai/gpu_unai.so"
compile_binary "$@"
}
+check_pulseaudio()
+{
+ cat > $TMPC <<EOF
+ #include <pulse/pulseaudio.h>
+ void main() { pa_threaded_mainloop_new(); }
+EOF
+ compile_binary "$@"
+}
+
check_sdl()
{
cat > $TMPC <<EOF
sound_drivers="$sound_drivers alsa"
MAIN_LDLIBS="-lasound $MAIN_LDLIBS"
fi
+ if check_pulseaudio -lpulse; then
+ sound_drivers="$sound_drivers pulseaudio"
+ MAIN_LDLIBS="-lpulse $MAIN_LDLIBS"
+ fi
if [ "$need_sdl" = "yes" ] || check_sdl `sdl-config --cflags --libs`; then
sound_drivers="$sound_drivers sdl"
need_sdl="yes"
MAIN_LDLIBS="-lasound $MAIN_LDLIBS"
check_alsa || fail "please install libasound2-dev"
fi
+ if echo $sound_drivers | grep -q "\<pulseaudio\>"; then
+ MAIN_LDLIBS="-lpulse $MAIN_LDLIBS"
+ check_pulseaudio || fail "pulseaudio support is missing"
+ fi
fi
if [ "$need_sdl" = "yes" ]; then
* *
***************************************************************************/
-#include "stdafx.h"
+#include <stdio.h>
-#define _IN_OSS
-
-#include "externals.h"
#include <pulse/pulseaudio.h>
+#include "out.h"
////////////////////////////////////////////////////////////////////////
// pulseaudio structs
// SETUP SOUND
////////////////////////////////////////////////////////////////////////
-static void pulse_init(void)
+static int pulse_init(void)
{
int error_number;
//pa_stream_flags_t flags = (pa_stream_flags_t) (PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE | PA_STREAM_EARLY_REQUESTS);
if (pa_stream_connect_playback (device.stream, NULL, &buffer_attributes, flags, NULL, NULL) < 0)
{
- pa_context_errno (device.context);
+ error_number = pa_context_errno (device.context);
fprintf (stderr, "Could not connect for playback: %s\n", pa_strerror (error_number));
return -1;
}
static int pulse_busy(void)
{
int free_space;
- int error_code;
- long latency;
- int playing = 0;
if ((device.mainloop == NULL) || (device.api == NULL) || ( device.context == NULL) || (device.stream == NULL))
return 1;
static void pulse_feed(void *pSound, int lBytes)
{
- int error_code;
- int size;
-
if (device.mainloop != NULL)
{
pa_threaded_mainloop_lock (device.mainloop);