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

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

revision 1365 by jsorg71, Thu Jan 4 05:39:39 2007 UTC revision 1427 by ossman_, Fri Jan 18 15:11:57 2008 UTC
# Line 50  static VCHANNEL *rdpsnddbg_channel; Line 50  static VCHANNEL *rdpsnddbg_channel;
50  static struct audio_driver *drivers = NULL;  static struct audio_driver *drivers = NULL;
51  struct audio_driver *current_driver = NULL;  struct audio_driver *current_driver = NULL;
52    
53  static BOOL device_open;  static RD_BOOL device_open;
54  static BOOL rec_device_open;  static RD_BOOL rec_device_open;
55    
56  static RD_WAVEFORMATEX formats[MAX_FORMATS];  static RD_WAVEFORMATEX formats[MAX_FORMATS];
57  static unsigned int format_count;  static unsigned int format_count;
# Line 64  unsigned int queue_hi, queue_lo, queue_p Line 64  unsigned int queue_hi, queue_lo, queue_p
64  struct audio_packet packet_queue[MAX_QUEUE];  struct audio_packet packet_queue[MAX_QUEUE];
65    
66  static char record_buffer[8192];  static char record_buffer[8192];
67  static int record_buffer_size;  static uint32 record_buffer_size;
68    
69  static uint8 packet_opcode;  static uint8 packet_opcode;
70  static struct stream packet;  static struct stream packet;
# Line 153  rdpsnd_flush_record(void) Line 153  rdpsnd_flush_record(void)
153  void  void
154  rdpsnd_record(const void *data, unsigned int size)  rdpsnd_record(const void *data, unsigned int size)
155  {  {
156          int remain;          uint32 remain;
157    
158          assert(rec_device_open);          assert(rec_device_open);
159    
# Line 178  rdpsnd_record(const void *data, unsigned Line 178  rdpsnd_record(const void *data, unsigned
178          }          }
179  }  }
180    
181  static BOOL  static RD_BOOL
182  rdpsnd_auto_select(void)  rdpsnd_auto_select(void)
183  {  {
184          static BOOL failed = False;          static RD_BOOL failed = False;
185    
186          if (!failed)          if (!failed)
187          {          {
# Line 214  rdpsnd_process_negotiate(STREAM in) Line 214  rdpsnd_process_negotiate(STREAM in)
214          uint16 version;          uint16 version;
215          RD_WAVEFORMATEX *format;          RD_WAVEFORMATEX *format;
216          STREAM out;          STREAM out;
217          BOOL device_available = False;          RD_BOOL device_available = False;
218          int readcnt;          int readcnt;
219          int discardcnt;          int discardcnt;
220    
# Line 263  rdpsnd_process_negotiate(STREAM in) Line 263  rdpsnd_process_negotiate(STREAM in)
263                          in_uint8a(in, format->cb, readcnt);                          in_uint8a(in, format->cb, readcnt);
264                          in_uint8s(in, discardcnt);                          in_uint8s(in, discardcnt);
265    
266                          if (device_available && current_driver->wave_out_format_supported(format))                          if (current_driver && current_driver->wave_out_format_supported(format))
267                          {                          {
268                                  format_count++;                                  format_count++;
269                                  if (format_count == MAX_FORMATS)                                  if (format_count == MAX_FORMATS)
# Line 328  rdpsnd_process_rec_negotiate(STREAM in) Line 328  rdpsnd_process_rec_negotiate(STREAM in)
328          uint16 version;          uint16 version;
329          RD_WAVEFORMATEX *format;          RD_WAVEFORMATEX *format;
330          STREAM out;          STREAM out;
331          BOOL device_available = False;          RD_BOOL device_available = False;
332          int readcnt;          int readcnt;
333          int discardcnt;          int discardcnt;
334    
# Line 376  rdpsnd_process_rec_negotiate(STREAM in) Line 376  rdpsnd_process_rec_negotiate(STREAM in)
376                          in_uint8a(in, format->cb, readcnt);                          in_uint8a(in, format->cb, readcnt);
377                          in_uint8s(in, discardcnt);                          in_uint8s(in, discardcnt);
378    
379                          if (device_available && current_driver->wave_in_format_supported(format))                          if (current_driver && current_driver->wave_in_format_supported
380                                && current_driver->wave_in_format_supported(format))
381                          {                          {
382                                  rec_format_count++;                                  rec_format_count++;
383                                  if (rec_format_count == MAX_FORMATS)                                  if (rec_format_count == MAX_FORMATS)
# Line 592  rdpsnd_process(STREAM s) Line 593  rdpsnd_process(STREAM s)
593          }          }
594  }  }
595    
596  static BOOL  static RD_BOOL
597  rdpsnddbg_line_handler(const char *line, void *data)  rdpsnddbg_line_handler(const char *line, void *data)
598  {  {
599  #ifdef WITH_DEBUG_SOUND  #ifdef WITH_DEBUG_SOUND
# Line 610  rdpsnddbg_process(STREAM s) Line 611  rdpsnddbg_process(STREAM s)
611    
612          pkglen = s->end - s->p;          pkglen = s->end - s->p;
613          /* str_handle_lines requires null terminated strings */          /* str_handle_lines requires null terminated strings */
614          buf = xmalloc(pkglen + 1);          buf = (char *) xmalloc(pkglen + 1);
615          STRNCPY(buf, (char *) s->p, pkglen + 1);          STRNCPY(buf, (char *) s->p, pkglen + 1);
616    
617          str_handle_lines(buf, &rest, rdpsnddbg_line_handler, NULL);          str_handle_lines(buf, &rest, rdpsnddbg_line_handler, NULL);
# Line 654  rdpsnd_register_drivers(char *options) Line 655  rdpsnd_register_drivers(char *options)
655          *reg = NULL;          *reg = NULL;
656  }  }
657    
658  BOOL  RD_BOOL
659  rdpsnd_init(char *optarg)  rdpsnd_init(char *optarg)
660  {  {
661          struct audio_driver *pos;          struct audio_driver *pos;
# Line 662  rdpsnd_init(char *optarg) Line 663  rdpsnd_init(char *optarg)
663    
664          drivers = NULL;          drivers = NULL;
665    
666          packet.data = xmalloc(65536);          packet.data = (uint8 *) xmalloc(65536);
667          packet.p = packet.end = packet.data;          packet.p = packet.end = packet.data;
668          packet.size = 0;          packet.size = 0;
669    
# Line 791  rdpsnd_queue_current_packet(void) Line 792  rdpsnd_queue_current_packet(void)
792          return &packet_queue[queue_lo];          return &packet_queue[queue_lo];
793  }  }
794    
795  BOOL  RD_BOOL
796  rdpsnd_queue_empty(void)  rdpsnd_queue_empty(void)
797  {  {
798          return (queue_lo == queue_hi);          return (queue_lo == queue_hi);

Legend:
Removed from v.1365  
changed lines
  Added in v.1427

  ViewVC Help
Powered by ViewVC 1.1.26