/[rdesktop]/sourceforge.net/trunk/rdesktop/rdpsnd_libao.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_libao.c

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

revision 1345 by ossman_, Thu Dec 7 11:54:29 2006 UTC revision 1346 by ossman_, Thu Dec 7 15:23:45 2006 UTC
# Line 36  static int default_driver; Line 36  static int default_driver;
36  static BOOL reopened;  static BOOL reopened;
37  static char *libao_device = NULL;  static char *libao_device = NULL;
38    
39    void libao_play(void);
40    
41    void
42    libao_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv)
43    {
44    }
45    
46    void
47    libao_check_fds(fd_set * rfds, fd_set * wfds)
48    {
49            if (o_device == NULL)
50                    return;
51    
52            if (!rdpsnd_queue_empty())
53                    libao_play();
54    }
55    
56  BOOL  BOOL
57  libao_open(void)  libao_open(void)
58  {  {
# Line 64  libao_open(void) Line 81  libao_open(void)
81                  return False;                  return False;
82          }          }
83    
         g_dsp_fd = 0;  
   
84          reopened = True;          reopened = True;
85    
86          return True;          return True;
# Line 83  libao_close(void) Line 98  libao_close(void)
98          if (o_device != NULL)          if (o_device != NULL)
99                  ao_close(o_device);                  ao_close(o_device);
100    
101            o_device = NULL;
102    
103          ao_shutdown();          ao_shutdown();
104  }  }
105    
# Line 134  libao_play(void) Line 151  libao_play(void)
151                  prev_us = tv.tv_usec;                  prev_us = tv.tv_usec;
152          }          }
153    
154            /* We shouldn't be called if the queue is empty, but still */
155          if (rdpsnd_queue_empty())          if (rdpsnd_queue_empty())
         {  
                 g_dsp_busy = 0;  
156                  return;                  return;
         }  
157    
158          packet = rdpsnd_queue_current_packet();          packet = rdpsnd_queue_current_packet();
159          out = &packet->s;          out = &packet->s;
# Line 170  libao_play(void) Line 185  libao_play(void)
185    
186                  rdpsnd_queue_next(duration);                  rdpsnd_queue_next(duration);
187          }          }
   
         g_dsp_busy = 1;  
         return;  
188  }  }
189    
190  static struct audio_driver libao_driver = {  static struct audio_driver libao_driver = {
191          .name = "libao",          .name = "libao",
192          .description = "libao output driver, default device: system dependent",          .description = "libao output driver, default device: system dependent",
193    
194            .add_fds = libao_add_fds,
195            .check_fds = libao_check_fds,
196    
197          .wave_out_open = libao_open,          .wave_out_open = libao_open,
198          .wave_out_close = libao_close,          .wave_out_close = libao_close,
199          .wave_out_format_supported = rdpsnd_dsp_resample_supported,          .wave_out_format_supported = rdpsnd_dsp_resample_supported,
200          .wave_out_set_format = libao_set_format,          .wave_out_set_format = libao_set_format,
201          .wave_out_volume = rdpsnd_dsp_softvol_set,          .wave_out_volume = rdpsnd_dsp_softvol_set,
         .wave_out_play = libao_play,  
202    
203          .need_byteswap_on_be = 1,          .need_byteswap_on_be = 1,
204          .need_resampling = 1,          .need_resampling = 1,

Legend:
Removed from v.1345  
changed lines
  Added in v.1346

  ViewVC Help
Powered by ViewVC 1.1.26