/[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 1276 by stargo, Sun Oct 1 12:16:50 2006 UTC revision 1290 by stargo, Sun Oct 1 22:30:34 2006 UTC
# Line 29  Line 29 
29  #include <ao/ao.h>  #include <ao/ao.h>
30  #include <sys/time.h>  #include <sys/time.h>
31    
32  #define WAVEOUTBUF      16  #define WAVEOUTLEN      1024
33    
34  static ao_device *o_device = NULL;  static ao_device *o_device = NULL;
35  static int default_driver;  static int default_driver;
# Line 55  libao_open(void) Line 55  libao_open(void)
55          format.bits = 16;          format.bits = 16;
56          format.channels = 2;          format.channels = 2;
57          format.rate = 44100;          format.rate = 44100;
58          format.byte_format = AO_FMT_LITTLE;          format.byte_format = AO_FMT_NATIVE;
59    
60    
61          o_device = ao_open_live(default_driver, &format, NULL);          o_device = ao_open_live(default_driver, &format, NULL);
62          if (o_device == NULL)          if (o_device == NULL)
# Line 96  libao_set_format(WAVEFORMATEX * pwfx) Line 97  libao_set_format(WAVEFORMATEX * pwfx)
97          format.bits = pwfx->wBitsPerSample;          format.bits = pwfx->wBitsPerSample;
98          format.channels = pwfx->nChannels;          format.channels = pwfx->nChannels;
99          format.rate = 44100;          format.rate = 44100;
100          format.byte_format = AO_FMT_LITTLE;          format.byte_format = AO_FMT_NATIVE;
101    
102          if (o_device != NULL)          if (o_device != NULL)
103                  ao_close(o_device);                  ao_close(o_device);
# Line 147  libao_play(void) Line 148  libao_play(void)
148    
149          next_tick = rdpsnd_queue_next_tick();          next_tick = rdpsnd_queue_next_tick();
150    
151          len = (WAVEOUTBUF > (out->end - out->p)) ? (out->end - out->p) : WAVEOUTBUF;          len = (WAVEOUTLEN > (out->end - out->p)) ? (out->end - out->p) : WAVEOUTLEN;
152          ao_play(o_device, (char *) out->p, len);          ao_play(o_device, (char *) out->p, len);
153          out->p += len;          out->p += len;
154    
# Line 194  libao_register(char *options) Line 195  libao_register(char *options)
195          libao_driver.wave_out_play = libao_play;          libao_driver.wave_out_play = libao_play;
196          libao_driver.name = xstrdup("libao");          libao_driver.name = xstrdup("libao");
197          libao_driver.description = description;          libao_driver.description = description;
198          libao_driver.need_byteswap_on_be = 0;          libao_driver.need_byteswap_on_be = 1;
199            libao_driver.need_resampling = 1;
200          libao_driver.next = NULL;          libao_driver.next = NULL;
201    
202          ao_initialize();          ao_initialize();

Legend:
Removed from v.1276  
changed lines
  Added in v.1290

  ViewVC Help
Powered by ViewVC 1.1.26