45 |
BOOL |
BOOL |
46 |
wave_out_open(void) |
wave_out_open(void) |
47 |
{ |
{ |
48 |
char *dsp_dev = "/dev/dsp"; |
char *dsp_dev = getenv("AUDIODEV"); |
49 |
|
|
50 |
|
if (dsp_dev == NULL) |
51 |
|
{ |
52 |
|
dsp_dev = "/dev/dsp"; |
53 |
|
} |
54 |
|
|
55 |
if ((g_dsp_fd = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1) |
if ((g_dsp_fd = open(dsp_dev, O_WRONLY | O_NONBLOCK)) == -1) |
56 |
{ |
{ |
140 |
|
|
141 |
if (use_dev_mixer) |
if (use_dev_mixer) |
142 |
{ |
{ |
143 |
if ((fd_mix = open( "/dev/mixer", O_RDWR|O_NONBLOCK )) == -1 ) |
if ((fd_mix = open("/dev/mixer", O_RDWR | O_NONBLOCK)) == -1) |
144 |
{ |
{ |
145 |
perror("open /dev/mixer"); |
perror("open /dev/mixer"); |
146 |
return; |
return; |
233 |
{ |
{ |
234 |
long long duration; |
long long duration; |
235 |
long elapsed; |
long elapsed; |
236 |
|
|
237 |
gettimeofday(&tv, NULL); |
gettimeofday(&tv, NULL); |
238 |
duration = |
duration = (out->size * (1000000 / (g_samplewidth * g_snd_rate))); |
239 |
(out->size * (1000000 / |
elapsed = (tv.tv_sec - startedat_s) * 1000000 + (tv.tv_usec - startedat_us); |
|
(g_samplewidth * g_snd_rate))); |
|
|
elapsed = |
|
|
(tv.tv_sec - startedat_s) * 1000000 + |
|
|
(tv.tv_usec - startedat_us); |
|
240 |
|
|
241 |
if ( elapsed >= (duration * 7) / 10 ) |
if (elapsed >= (duration * 7) / 10) |
242 |
{ |
{ |
243 |
rdpsnd_send_completion(packet->tick, packet->index); |
rdpsnd_send_completion(packet->tick, packet->index); |
244 |
free(out->data); |
free(out->data); |