/[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 1427 by ossman_, Fri Jan 18 15:11:57 2008 UTC revision 1430 by ossman_, Fri Feb 8 10:34:53 2008 UTC
# Line 59  static unsigned int current_format; Line 59  static unsigned int current_format;
59    
60  static RD_WAVEFORMATEX rec_formats[MAX_FORMATS];  static RD_WAVEFORMATEX rec_formats[MAX_FORMATS];
61  static unsigned int rec_format_count;  static unsigned int rec_format_count;
62    static unsigned int rec_current_format;
63    
64  unsigned int queue_hi, queue_lo, queue_pending;  unsigned int queue_hi, queue_lo, queue_pending;
65  struct audio_packet packet_queue[MAX_QUEUE];  struct audio_packet packet_queue[MAX_QUEUE];
# Line 153  rdpsnd_flush_record(void) Line 154  rdpsnd_flush_record(void)
154  void  void
155  rdpsnd_record(const void *data, unsigned int size)  rdpsnd_record(const void *data, unsigned int size)
156  {  {
157          uint32 remain;          uint32 remain, chunk;
158    
159          assert(rec_device_open);          assert(rec_device_open);
160    
# Line 162  rdpsnd_record(const void *data, unsigned Line 163  rdpsnd_record(const void *data, unsigned
163                  remain = sizeof(record_buffer) - record_buffer_size;                  remain = sizeof(record_buffer) - record_buffer_size;
164    
165                  if (size >= remain)                  if (size >= remain)
166                  {                          chunk = remain;
                         memcpy(record_buffer + record_buffer_size, data, remain);  
                         record_buffer_size += remain;  
                         rdpsnd_flush_record();  
                         data = (const char *) data + remain;  
                         size -= remain;  
                 }  
167                  else                  else
168                  {                          chunk = size;
169                          memcpy(record_buffer + record_buffer_size, data, size);  
170                          record_buffer_size += size;                  memcpy(record_buffer + record_buffer_size, data, chunk);
171                          size = 0;  
172                  }  #ifdef B_ENDIAN
173                    if (current_driver->need_byteswap_on_be)
174                            rdpsnd_dsp_swapbytes(record_buffer + record_buffer_size,
175                                                 chunk, &rec_formats[rec_current_format]);
176    #endif
177    
178                    record_buffer_size += chunk;
179    
180                    data = (const char *) data + chunk;
181                    size -= chunk;
182    
183                    if (record_buffer_size == sizeof(record_buffer))
184                            rdpsnd_flush_record();
185          }          }
186  }  }
187    
# Line 513  rdpsnd_process_packet(uint8 opcode, STRE Line 520  rdpsnd_process_packet(uint8 opcode, STRE
520                                  current_driver->wave_in_close();                                  current_driver->wave_in_close();
521                                  break;                                  break;
522                          }                          }
523                            rec_current_format = format;
524                          rec_device_open = True;                          rec_device_open = True;
525                          break;                          break;
526                  case RDPSND_REC_STOP:                  case RDPSND_REC_STOP:

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

  ViewVC Help
Powered by ViewVC 1.1.26