1 --- SDL-1.2.13/src/audio/pulse/SDL_pulseaudio.c 2007-12-31 05:47:58.000000000 +0100
2 +++ SDL-1.2.13.lennart/src/audio/pulse/SDL_pulseaudio.c 2008-03-31 16:09:05.000000000 +0200
4 +/* -*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*- */
6 SDL - Simple DirectMedia Layer
7 Copyright (C) 1997-2007 Sam Lantinga
14 Based on parts of the ALSA and ESounD output drivers.
16 #include "SDL_config.h"
17 @@ -78,14 +79,14 @@ static int (*SDL_NAME(pa_simple_write))(
24 static pa_channel_map* (*SDL_NAME(pa_channel_map_init_auto))(
27 pa_channel_map_def_t def
34 @@ -158,16 +159,16 @@ static int Audio_Available(void)
35 if ( LoadPulseLibrary() < 0 ) {
40 /* Connect with a dummy format. */
41 paspec.format = PA_SAMPLE_U8;
44 connection = SDL_NAME(pa_simple_new)(
45 - SDL_getenv("PASERVER"), /* server */
47 "Test stream", /* application name */
48 PA_STREAM_PLAYBACK, /* playback mode */
49 - SDL_getenv("PADEVICE"), /* device on the server */
50 + NULL, /* device on the server */
51 "Simple DirectMedia Layer", /* stream description */
52 &paspec, /* sample format spec */
53 NULL, /* channel map */
54 @@ -178,7 +179,7 @@ static int Audio_Available(void)
56 SDL_NAME(pa_simple_free)(connection);
63 @@ -233,7 +234,7 @@ static void PULSE_WaitAudio(_THIS)
65 /* Check to see if the thread-parent process is still alive */
67 - /* Note that this only works with thread implementations
68 + /* Note that this only works with thread implementations
69 that use a different process id for each thread.
71 if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */
72 @@ -302,7 +303,7 @@ static int PULSE_OpenAudio(_THIS, SDL_Au
73 pa_sample_spec paspec;
74 pa_buffer_attr paattr;
75 pa_channel_map pacmap;
78 paspec.format = PA_SAMPLE_INVALID;
79 for ( test_format = SDL_FirstAudioFormat(spec->format); test_format; ) {
80 switch ( test_format ) {
81 @@ -324,7 +325,7 @@ static int PULSE_OpenAudio(_THIS, SDL_Au
84 spec->format = test_format;
87 paspec.channels = spec->channels;
88 paspec.rate = spec->freq;
90 @@ -338,25 +339,24 @@ static int PULSE_OpenAudio(_THIS, SDL_Au
93 SDL_memset(mixbuf, spec->silence, spec->size);
96 /* Reduced prebuffering compared to the defaults. */
97 - paattr.tlength = mixlen;
98 + paattr.tlength = mixlen*2;
99 paattr.minreq = mixlen;
100 - paattr.fragsize = mixlen;
101 - paattr.prebuf = mixlen;
102 - paattr.maxlength = mixlen * 4;
104 + paattr.prebuf = mixlen*2;
105 + paattr.maxlength = mixlen*2;
107 /* The SDL ALSA output hints us that we use Windows' channel mapping */
108 /* http://bugzilla.libsdl.org/show_bug.cgi?id=110 */
109 SDL_NAME(pa_channel_map_init_auto)(
110 &pacmap, spec->channels, PA_CHANNEL_MAP_WAVEEX);
113 /* Connect to the PulseAudio server */
114 stream = SDL_NAME(pa_simple_new)(
115 - SDL_getenv("PASERVER"), /* server */
117 get_progname(), /* application name */
118 PA_STREAM_PLAYBACK, /* playback mode */
119 - SDL_getenv("PADEVICE"), /* device on the server */
120 + NULL, /* device on the server */
121 "Simple DirectMedia Layer", /* stream description */
122 &paspec, /* sample format spec */
123 &pacmap, /* channel map */
124 @@ -371,7 +371,6 @@ static int PULSE_OpenAudio(_THIS, SDL_Au
126 /* Get the parent process id (we're the parent of the audio thread) */