21 |
|
|
22 |
#include "rdesktop.h" |
#include "rdesktop.h" |
23 |
#include "rdpsnd.h" |
#include "rdpsnd.h" |
24 |
|
#include "rdpsnd_dsp.h" |
25 |
|
|
26 |
#define RDPSND_CLOSE 1 |
#define RDPSND_CLOSE 1 |
27 |
#define RDPSND_WRITE 2 |
#define RDPSND_WRITE 2 |
39 |
|
|
40 |
static VCHANNEL *rdpsnd_channel; |
static VCHANNEL *rdpsnd_channel; |
41 |
static struct audio_driver *drivers = NULL; |
static struct audio_driver *drivers = NULL; |
42 |
static struct audio_driver *current_driver = NULL; |
struct audio_driver *current_driver = NULL; |
43 |
|
|
44 |
static BOOL device_open; |
static BOOL device_open; |
45 |
static WAVEFORMATEX formats[MAX_FORMATS]; |
static WAVEFORMATEX formats[MAX_FORMATS]; |
46 |
static unsigned int format_count; |
static unsigned int format_count; |
47 |
static unsigned int current_format; |
static unsigned int current_format; |
48 |
static unsigned int queue_hi, queue_lo; |
unsigned int queue_hi, queue_lo; |
49 |
static struct audio_packet packet_queue[MAX_QUEUE]; |
struct audio_packet packet_queue[MAX_QUEUE]; |
50 |
|
|
51 |
void (*wave_out_play) (void); |
void (*wave_out_play) (void); |
52 |
|
|
394 |
queue_hi = next_hi; |
queue_hi = next_hi; |
395 |
|
|
396 |
packet->s = *s; |
packet->s = *s; |
397 |
|
packet->s.data = |
398 |
|
rdpsnd_dsp_process(s->data, s->size, current_driver, &formats[current_format]); |
399 |
|
packet->s.p = packet->s.data + 4; |
400 |
|
packet->s.end = packet->s.data + s->size; |
401 |
packet->tick = tick; |
packet->tick = tick; |
402 |
packet->index = index; |
packet->index = index; |
|
packet->s.p += 4; |
|
403 |
|
|
404 |
|
#if 0 /* Handled by DSP */ |
405 |
/* we steal the data buffer from s, give it a new one */ |
/* we steal the data buffer from s, give it a new one */ |
406 |
s->data = malloc(s->size); |
s->data = xmalloc(s->size); |
407 |
|
#endif |
408 |
|
|
409 |
if (!g_dsp_busy) |
if (!g_dsp_busy) |
410 |
current_driver->wave_out_play(); |
current_driver->wave_out_play(); |
431 |
inline void |
inline void |
432 |
rdpsnd_queue_next(void) |
rdpsnd_queue_next(void) |
433 |
{ |
{ |
434 |
free(packet_queue[queue_lo].s.data); |
xfree(packet_queue[queue_lo].s.data); |
435 |
queue_lo = (queue_lo + 1) % MAX_QUEUE; |
queue_lo = (queue_lo + 1) % MAX_QUEUE; |
436 |
} |
} |
437 |
|
|