/[rdesktop]/sourceforge.net/trunk/rdesktop/rdpsnd_oss.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/rdpsnd_oss.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 510 by stargo, Thu Oct 23 11:11:31 2003 UTC revision 751 by stargo, Fri Aug 13 09:43:31 2004 UTC
# Line 45  static unsigned int queue_hi, queue_lo; Line 45  static unsigned int queue_hi, queue_lo;
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          {          {
# Line 135  wave_out_volume(uint16 left, uint16 righ Line 140  wave_out_volume(uint16 left, uint16 righ
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;
# Line 228  wave_out_play(void) Line 233  wave_out_play(void)
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);

Legend:
Removed from v.510  
changed lines
  Added in v.751

  ViewVC Help
Powered by ViewVC 1.1.26