/[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 1255 by stargo, Sun Sep 17 11:04:50 2006 UTC revision 1268 by stargo, Mon Sep 18 09:34:34 2006 UTC
# Line 22  Line 22 
22    
23  #include "rdesktop.h"  #include "rdesktop.h"
24  #include "rdpsnd.h"  #include "rdpsnd.h"
25    #include "rdpsnd_dsp.h"
26  #include <unistd.h>  #include <unistd.h>
27  #include <fcntl.h>  #include <fcntl.h>
28  #include <errno.h>  #include <errno.h>
# Line 42  BOOL Line 43  BOOL
43  libao_open(void)  libao_open(void)
44  {  {
45          ao_sample_format format;          ao_sample_format format;
         static int warned = 0;  
46    
47          if (!warned && libao_device)          ao_initialize();
48    
49            if (libao_device)
50          {          {
51                  warning("device-options not supported for libao-driver\n");                  default_driver = ao_driver_id(libao_device);
52                  warned = 1;          }
53            else
54            {
55                    default_driver = ao_default_driver_id();
56          }          }
   
         ao_initialize();  
         default_driver = ao_default_driver_id();  
57    
58          format.bits = 16;          format.bits = 16;
59          format.channels = 2;          format.channels = 2;
# Line 137  libao_set_format(WAVEFORMATEX * pwfx) Line 139  libao_set_format(WAVEFORMATEX * pwfx)
139  }  }
140    
141  void  void
 libao_volume(uint16 left, uint16 right)  
 {  
         warning("volume changes not supported with libao-output\n");  
 }  
   
 void  
142  libao_play(void)  libao_play(void)
143  {  {
144          struct audio_packet *packet;          struct audio_packet *packet;
# Line 234  libao_play(void) Line 230  libao_play(void)
230          return;          return;
231  }  }
232    
 static struct audio_driver libao_driver = {  
       wave_out_write:rdpsnd_queue_write,  
       wave_out_open:libao_open,  
       wave_out_close:libao_close,  
       wave_out_format_supported:libao_format_supported,  
       wave_out_set_format:libao_set_format,  
       wave_out_volume:libao_volume,  
       wave_out_play:libao_play,  
       name:"libao",  
       description:"libao output driver",  
       next:NULL,  
 };  
   
233  struct audio_driver *  struct audio_driver *
234  libao_register(char *options)  libao_register(char *options)
235  {  {
236            static struct audio_driver libao_driver;
237            struct ao_info *libao_info;
238            static char description[101];
239    
240            libao_driver.wave_out_write = rdpsnd_queue_write;
241            libao_driver.wave_out_open = libao_open;
242            libao_driver.wave_out_close = libao_close;
243            libao_driver.wave_out_format_supported = libao_format_supported;
244            libao_driver.wave_out_set_format = libao_set_format;
245            libao_driver.wave_out_volume = rdpsnd_dsp_softvol_set;
246            libao_driver.wave_out_play = libao_play;
247            libao_driver.name = xstrdup("libao");
248            libao_driver.description = description;
249            libao_driver.need_byteswap_on_be = 0;
250            libao_driver.next = NULL;
251    
252            ao_initialize();
253    
254            libao_info = ao_driver_info(ao_default_driver_id());
255    
256            if (libao_info)
257            {
258                    snprintf(description, 100, "libao output driver, default device: %s",
259                                    libao_info->short_name);
260            }
261            else
262            {
263                    snprintf(description, 100, "libao output driver, default device: none");
264            }
265    
266            ao_shutdown();
267    
268          if (options)          if (options)
269          {          {
270                  libao_device = xstrdup(options);                  libao_device = xstrdup(options);

Legend:
Removed from v.1255  
changed lines
  Added in v.1268

  ViewVC Help
Powered by ViewVC 1.1.26