/[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 1256 by stargo, Sun Sep 17 11:42:22 2006 UTC revision 1265 by stargo, Sun Sep 17 20:06:37 2006 UTC
# Line 21  Line 21 
21    
22  #include "rdesktop.h"  #include "rdesktop.h"
23  #include "rdpsnd.h"  #include "rdpsnd.h"
24    #include "rdpsnd_dsp.h"
25    
26  #define RDPSND_CLOSE            1  #define RDPSND_CLOSE            1
27  #define RDPSND_WRITE            2  #define RDPSND_WRITE            2
# Line 193  rdpsnd_process(STREAM s) Line 194  rdpsnd_process(STREAM s)
194          static uint16 tick, format;          static uint16 tick, format;
195          static uint8 packet_index;          static uint8 packet_index;
196          static BOOL awaiting_data_packet;          static BOOL awaiting_data_packet;
197            static unsigned char missing_bytes[4] = { 0, 0, 0, 0 };
198    
199  #ifdef RDPSND_DEBUG  #ifdef RDPSND_DEBUG
200          printf("RDPSND recv:\n");          printf("RDPSND recv:\n");
# Line 225  rdpsnd_process(STREAM s) Line 227  rdpsnd_process(STREAM s)
227                          current_format = format;                          current_format = format;
228                  }                  }
229    
230                  current_driver->wave_out_write(s, tick, packet_index);                  /* Insert the 4 missing bytes retrieved from last RDPSND_WRITE */
231                    memcpy(s->data, missing_bytes, 4);
232    
233                    current_driver->
234                            wave_out_write(rdpsnd_dsp_process
235                                           (s, current_driver, &formats[current_format]), tick,
236                                           packet_index);
237                  awaiting_data_packet = False;                  awaiting_data_packet = False;
238                  return;                  return;
239          }          }
# Line 240  rdpsnd_process(STREAM s) Line 248  rdpsnd_process(STREAM s)
248                          in_uint16_le(s, tick);                          in_uint16_le(s, tick);
249                          in_uint16_le(s, format);                          in_uint16_le(s, format);
250                          in_uint8(s, packet_index);                          in_uint8(s, packet_index);
251                            /* Here are our lost bytes, but why? */
252                            memcpy(missing_bytes, s->end - 4, 4);
253                          awaiting_data_packet = True;                          awaiting_data_packet = True;
254                          break;                          break;
255                  case RDPSND_CLOSE:                  case RDPSND_CLOSE:
# Line 309  rdpsnd_register_drivers(char *options) Line 319  rdpsnd_register_drivers(char *options)
319          *reg = alsa_register(options);          *reg = alsa_register(options);
320          reg = &((*reg)->next);          reg = &((*reg)->next);
321  #endif  #endif
 #if defined(RDPSND_OSS)  
         *reg = oss_register(options);  
         reg = &((*reg)->next);  
 #endif  
322  #if defined(RDPSND_SUN)  #if defined(RDPSND_SUN)
323          *reg = sun_register(options);          *reg = sun_register(options);
324          reg = &((*reg)->next);          reg = &((*reg)->next);
325  #endif  #endif
326    #if defined(RDPSND_OSS)
327            *reg = oss_register(options);
328            reg = &((*reg)->next);
329    #endif
330  #if defined(RDPSND_SGI)  #if defined(RDPSND_SGI)
331          *reg = sgi_register(options);          *reg = sgi_register(options);
332          reg = &((*reg)->next);          reg = &((*reg)->next);
# Line 395  rdpsnd_queue_write(STREAM s, uint16 tick Line 405  rdpsnd_queue_write(STREAM s, uint16 tick
405          packet->s = *s;          packet->s = *s;
406          packet->tick = tick;          packet->tick = tick;
407          packet->index = index;          packet->index = index;
         packet->s.p += 4;  
   
         /* we steal the data buffer from s, give it a new one */  
         s->data = malloc(s->size);  
408    
409          if (!g_dsp_busy)          if (!g_dsp_busy)
410                  current_driver->wave_out_play();                  current_driver->wave_out_play();
# Line 425  rdpsnd_queue_init(void) Line 431  rdpsnd_queue_init(void)
431  inline void  inline void
432  rdpsnd_queue_next(void)  rdpsnd_queue_next(void)
433  {  {
434          free(packet_queue[queue_lo].s.data);          xfree(packet_queue[queue_lo].s.data);
435          queue_lo = (queue_lo + 1) % MAX_QUEUE;          queue_lo = (queue_lo + 1) % MAX_QUEUE;
436  }  }
437    

Legend:
Removed from v.1256  
changed lines
  Added in v.1265

  ViewVC Help
Powered by ViewVC 1.1.26