35 |
#define DEFAULTDEVICE "/dev/audio" |
#define DEFAULTDEVICE "/dev/audio" |
36 |
|
|
37 |
static BOOL g_reopened; |
static BOOL g_reopened; |
|
static BOOL g_swapaudio; |
|
38 |
static short g_samplewidth; |
static short g_samplewidth; |
39 |
static char *dsp_dev; |
static char *dsp_dev; |
40 |
|
|
96 |
audio_info_t info; |
audio_info_t info; |
97 |
|
|
98 |
ioctl(g_dsp_fd, AUDIO_DRAIN, 0); |
ioctl(g_dsp_fd, AUDIO_DRAIN, 0); |
|
g_swapaudio = False; |
|
99 |
AUDIO_INITINFO(&info); |
AUDIO_INITINFO(&info); |
100 |
|
|
101 |
|
|
106 |
else if (pwfx->wBitsPerSample == 16) |
else if (pwfx->wBitsPerSample == 16) |
107 |
{ |
{ |
108 |
info.play.encoding = AUDIO_ENCODING_LINEAR; |
info.play.encoding = AUDIO_ENCODING_LINEAR; |
|
/* Do we need to swap the 16bit values? (Are we BigEndian) */ |
|
|
#ifdef B_ENDIAN |
|
|
g_swapaudio = 1; |
|
|
#else |
|
|
g_swapaudio = 0; |
|
|
#endif |
|
109 |
} |
} |
110 |
|
|
111 |
g_samplewidth = pwfx->wBitsPerSample / 8; |
g_samplewidth = pwfx->wBitsPerSample / 8; |
176 |
audio_info_t info; |
audio_info_t info; |
177 |
ssize_t len; |
ssize_t len; |
178 |
unsigned int i; |
unsigned int i; |
|
uint8 swap; |
|
179 |
STREAM out; |
STREAM out; |
|
static BOOL swapped = False; |
|
180 |
static BOOL sentcompletion = True; |
static BOOL sentcompletion = True; |
181 |
static uint32 samplecnt = 0; |
static uint32 samplecnt = 0; |
182 |
static uint32 numsamples; |
static uint32 numsamples; |
187 |
{ |
{ |
188 |
/* Device was just (re)openend */ |
/* Device was just (re)openend */ |
189 |
samplecnt = 0; |
samplecnt = 0; |
|
swapped = False; |
|
190 |
sentcompletion = True; |
sentcompletion = True; |
191 |
g_reopened = False; |
g_reopened = False; |
192 |
} |
} |
200 |
packet = rdpsnd_queue_current_packet(); |
packet = rdpsnd_queue_current_packet(); |
201 |
out = &packet->s; |
out = &packet->s; |
202 |
|
|
|
/* Swap the current packet, but only once */ |
|
|
if (g_swapaudio && !swapped) |
|
|
{ |
|
|
for (i = 0; i < out->end - out->p; i += 2) |
|
|
{ |
|
|
swap = *(out->p + i); |
|
|
*(out->p + i) = *(out->p + i + 1); |
|
|
*(out->p + i + 1) = swap; |
|
|
} |
|
|
swapped = True; |
|
|
} |
|
|
|
|
203 |
if (sentcompletion) |
if (sentcompletion) |
204 |
{ |
{ |
205 |
sentcompletion = False; |
sentcompletion = False; |
237 |
* playing this packet */ |
* playing this packet */ |
238 |
rdpsnd_send_completion(packet->tick + 50, packet->index); |
rdpsnd_send_completion(packet->tick + 50, packet->index); |
239 |
rdpsnd_queue_next(); |
rdpsnd_queue_next(); |
|
swapped = False; |
|
240 |
sentcompletion = True; |
sentcompletion = True; |
241 |
} |
} |
242 |
else |
else |
263 |
sun_driver.name = xstrdup("sun"); |
sun_driver.name = xstrdup("sun"); |
264 |
sun_driver.description = |
sun_driver.description = |
265 |
xstrdup("SUN/BSD output driver, default device: " DEFAULTDEVICE " or $AUDIODEV"); |
xstrdup("SUN/BSD output driver, default device: " DEFAULTDEVICE " or $AUDIODEV"); |
266 |
|
sun_driver.need_byteswap_on_be = 1; |
267 |
sun_driver.next = NULL; |
sun_driver.next = NULL; |
268 |
|
|
269 |
if (options) |
if (options) |