From b68bf5c238ef32ed93eb8935c5b0288da5b3ad67 Mon Sep 17 00:00:00 2001 From: notaz Date: Sun, 23 Dec 2012 02:21:53 +0200 Subject: [PATCH] frontend: fix pulseaudio, detect it in configure script --- configure | 19 ++++++++++++++++++- plugins/dfsound/pulseaudio.c | 16 ++++------------ 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/configure b/configure index f55e9b65..eb859bfe 100755 --- a/configure +++ b/configure @@ -36,7 +36,7 @@ platform_list="generic pandora maemo caanoo libretro" 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" @@ -308,6 +308,15 @@ EOF compile_binary "$@" } +check_pulseaudio() +{ + cat > $TMPC < + void main() { pa_threaded_mainloop_new(); } +EOF + compile_binary "$@" +} + check_sdl() { cat > $TMPC <"; then + MAIN_LDLIBS="-lpulse $MAIN_LDLIBS" + check_pulseaudio || fail "pulseaudio support is missing" + fi fi if [ "$need_sdl" = "yes" ]; then diff --git a/plugins/dfsound/pulseaudio.c b/plugins/dfsound/pulseaudio.c index 057c2c4d..8ffd58fc 100644 --- a/plugins/dfsound/pulseaudio.c +++ b/plugins/dfsound/pulseaudio.c @@ -17,12 +17,10 @@ comment : Much of this was taken from simple.c, in the pulseaudio * * ***************************************************************************/ -#include "stdafx.h" +#include -#define _IN_OSS - -#include "externals.h" #include +#include "out.h" //////////////////////////////////////////////////////////////////////// // pulseaudio structs @@ -134,7 +132,7 @@ static void stream_request_cb (pa_stream *stream, size_t length, void *userdata) // SETUP SOUND //////////////////////////////////////////////////////////////////////// -static void pulse_init(void) +static int pulse_init(void) { int error_number; @@ -227,7 +225,7 @@ static void pulse_init(void) //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; } @@ -296,9 +294,6 @@ static void pulse_finish(void) 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; @@ -329,9 +324,6 @@ static int pulse_busy(void) static void pulse_feed(void *pSound, int lBytes) { - int error_code; - int size; - if (device.mainloop != NULL) { pa_threaded_mainloop_lock (device.mainloop); -- 2.39.2