31 |
ALconfig audioconfig; |
ALconfig audioconfig; |
32 |
ALport output_port; |
ALport output_port; |
33 |
|
|
|
static BOOL g_swapaudio; |
|
34 |
static int g_snd_rate; |
static int g_snd_rate; |
|
static BOOL g_swapaudio; |
|
35 |
static int width = AL_SAMPLE_16; |
static int width = AL_SAMPLE_16; |
36 |
static char *sgi_output_device = NULL; |
static char *sgi_output_device = NULL; |
37 |
|
|
139 |
fprintf(stderr, "sgi_set_format: init...\n"); |
fprintf(stderr, "sgi_set_format: init...\n"); |
140 |
#endif |
#endif |
141 |
|
|
|
g_swapaudio = False; |
|
142 |
if (pwfx->wBitsPerSample == 8) |
if (pwfx->wBitsPerSample == 8) |
143 |
width = AL_SAMPLE_8; |
width = AL_SAMPLE_8; |
144 |
else if (pwfx->wBitsPerSample == 16) |
else if (pwfx->wBitsPerSample == 16) |
|
{ |
|
145 |
width = AL_SAMPLE_16; |
width = AL_SAMPLE_16; |
|
/* Do we need to swap the 16bit values? (Are we BigEndian) */ |
|
|
#if (defined(B_ENDIAN)) |
|
|
g_swapaudio = 1; |
|
|
#else |
|
|
g_swapaudio = 0; |
|
|
#endif |
|
|
} |
|
146 |
|
|
147 |
/* Limited support to configure an opened audio port in IRIX. The |
/* Limited support to configure an opened audio port in IRIX. The |
148 |
number of channels is a static setting and can not be changed after |
number of channels is a static setting and can not be changed after |
242 |
struct audio_packet *packet; |
struct audio_packet *packet; |
243 |
ssize_t len; |
ssize_t len; |
244 |
unsigned int i; |
unsigned int i; |
|
uint8 swap; |
|
245 |
STREAM out; |
STREAM out; |
|
static BOOL swapped = False; |
|
246 |
int gf; |
int gf; |
247 |
|
|
248 |
while (1) |
while (1) |
256 |
packet = rdpsnd_queue_current_packet(); |
packet = rdpsnd_queue_current_packet(); |
257 |
out = &packet->s; |
out = &packet->s; |
258 |
|
|
|
/* 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; |
|
|
} |
|
|
|
|
259 |
len = out->end - out->p; |
len = out->end - out->p; |
260 |
|
|
261 |
alWriteFrames(output_port, out->p, len / combinedFrameSize); |
alWriteFrames(output_port, out->p, len / combinedFrameSize); |
268 |
{ |
{ |
269 |
rdpsnd_send_completion(packet->tick, packet->index); |
rdpsnd_send_completion(packet->tick, packet->index); |
270 |
rdpsnd_queue_next(); |
rdpsnd_queue_next(); |
|
swapped = False; |
|
271 |
} |
} |
272 |
else |
else |
273 |
{ |
{ |
296 |
sgi_driver.wave_out_play = sgi_play; |
sgi_driver.wave_out_play = sgi_play; |
297 |
sgi_driver.name = xstrdup("sgi"); |
sgi_driver.name = xstrdup("sgi"); |
298 |
sgi_driver.description = xstrdup("SGI output driver"); |
sgi_driver.description = xstrdup("SGI output driver"); |
299 |
|
sgi_driver.need_byteswap_on_be = 1; |
300 |
sgi_driver.next = NULL; |
sgi_driver.next = NULL; |
301 |
|
|
302 |
if (options) |
if (options) |