/[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 1352 by stargo, Sun Dec 24 15:16:45 2006 UTC revision 1422 by stargo, Tue Oct 30 13:57:31 2007 UTC
# Line 1  Line 1 
1  /* -*- c-basic-offset: 8 -*-  /* -*- c-basic-offset: 8 -*-
2     rdesktop: A Remote Desktop Protocol client.     rdesktop: A Remote Desktop Protocol client.
3     Sound Channel Process Functions - libao-driver     Sound Channel Process Functions - libao-driver
4     Copyright (C) Matthew Chapman 2003     Copyright (C) Matthew Chapman 2003-2007
5     Copyright (C) GuoJunBo guojunbo@ict.ac.cn 2003     Copyright (C) GuoJunBo guojunbo@ict.ac.cn 2003
6     Copyright (C) Michael Gernoth mike@zerfleddert.de 2005-2006     Copyright (C) Michael Gernoth mike@zerfleddert.de 2005-2007
7    
8     This program is free software; you can redistribute it and/or modify     This program is free software; you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by     it under the terms of the GNU General Public License as published by
# Line 33  Line 33 
33    
34  static ao_device *o_device = NULL;  static ao_device *o_device = NULL;
35  static int default_driver;  static int default_driver;
36  static BOOL reopened;  static RD_BOOL reopened;
37  static char *libao_device = NULL;  static char *libao_device = NULL;
38    
39  void libao_play(void);  void libao_play(void);
# Line 42  void Line 42  void
42  libao_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv)  libao_add_fds(int *n, fd_set * rfds, fd_set * wfds, struct timeval *tv)
43  {  {
44          /* We need to be called rather often... */          /* We need to be called rather often... */
45          FD_SET(0, wfds);          if (o_device != NULL && !rdpsnd_queue_empty())
46                    FD_SET(0, wfds);
47  }  }
48    
49  void  void
# Line 55  libao_check_fds(fd_set * rfds, fd_set * Line 56  libao_check_fds(fd_set * rfds, fd_set *
56                  libao_play();                  libao_play();
57  }  }
58    
59  BOOL  RD_BOOL
60  libao_open(void)  libao_open(void)
61  {  {
62          ao_sample_format format;          ao_sample_format format;
# Line 105  libao_close(void) Line 106  libao_close(void)
106          ao_shutdown();          ao_shutdown();
107  }  }
108    
109  BOOL  RD_BOOL
110  libao_set_format(WAVEFORMATEX * pwfx)  libao_set_format(RD_WAVEFORMATEX * pwfx)
111  {  {
112          ao_sample_format format;          ao_sample_format format;
113    
# Line 187  libao_play(void) Line 188  libao_play(void)
188                                 (packet->tick + duration) % 65536, next_tick % 65536));                                 (packet->tick + duration) % 65536, next_tick % 65536));
189                  }                  }
190    
191                  delay_us = ((out->size/4) * (1000000 / 44100));                  delay_us = ((out->size / 4) * (1000000 / 44100));
192    
193                  rdpsnd_queue_next(delay_us);                  rdpsnd_queue_next(delay_us);
194          }          }
# Line 198  libao_register(char *options) Line 199  libao_register(char *options)
199  {  {
200          static struct audio_driver libao_driver;          static struct audio_driver libao_driver;
201    
202          libao_driver.name = xstrdup("libao");          memset(&libao_driver, 0, sizeof(libao_driver));
203          libao_driver.description = xstrdup("libao output driver, default device: system dependent");  
204            libao_driver.name = "libao";
205            libao_driver.description = "libao output driver, default device: system dependent";
206    
207          libao_driver.add_fds = libao_add_fds;          libao_driver.add_fds = libao_add_fds;
208          libao_driver.check_fds = libao_check_fds;          libao_driver.check_fds = libao_check_fds;

Legend:
Removed from v.1352  
changed lines
  Added in v.1422

  ViewVC Help
Powered by ViewVC 1.1.26