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

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

revision 1258 by stargo, Sun Sep 17 14:41:16 2006 UTC revision 1259 by stargo, Sun Sep 17 15:08:48 2006 UTC
# Line 36  rdpsnd_dsp_softvol_set(uint16 left, uint Line 36  rdpsnd_dsp_softvol_set(uint16 left, uint
36  }  }
37    
38  inline void  inline void
39  rdpsnd_dsp_softvol(unsigned char *inbuffer, unsigned char *outbuffer, unsigned int size,  rdpsnd_dsp_softvol(unsigned char *buffer, unsigned int size, WAVEFORMATEX * format)
                    WAVEFORMATEX * format)  
40  {  {
41          unsigned int factor_left, factor_right;          unsigned int factor_left, factor_right;
42          unsigned char *posin = inbuffer;          unsigned char *posin = buffer;
43          unsigned char *posout = outbuffer;          unsigned char *posout = buffer;
44    
45            if ((softvol_left == MAX_VOLUME) && (softvol_right == MAX_VOLUME))
46                    return;
47    
48          factor_left = (softvol_left * 256) / 65535;          factor_left = (softvol_left * 256) / 65535;
49          factor_right = (softvol_right * 256) / 65535;          factor_right = (softvol_right * 256) / 65535;
# Line 55  rdpsnd_dsp_softvol(unsigned char *inbuff Line 57  rdpsnd_dsp_softvol(unsigned char *inbuff
57          {          {
58                  char val;                  char val;
59    
60                  while (posout < outbuffer + size)                  while (posout < buffer + size)
61                  {                  {
62                          /* Left */                          /* Left */
63                          val = *posin++;                          val = *posin++;
# Line 72  rdpsnd_dsp_softvol(unsigned char *inbuff Line 74  rdpsnd_dsp_softvol(unsigned char *inbuff
74          {          {
75                  short val;                  short val;
76    
77                  while (posout < outbuffer + size)                  while (posout < buffer + size)
78                  {                  {
79                          /* Left */                          /* Left */
80                          val = *posin++;                          val = *posin++;
# Line 102  rdpsnd_dsp_process(unsigned char *inbuff Line 104  rdpsnd_dsp_process(unsigned char *inbuff
104    
105          outbuffer = xmalloc(size);          outbuffer = xmalloc(size);
106    
107            memcpy(outbuffer, inbuffer, size);
108    
109          /* Software volume control */          /* Software volume control */
110          if (current_driver->wave_out_volume == rdpsnd_dsp_softvol_set)          if (current_driver->wave_out_volume == rdpsnd_dsp_softvol_set)
111          {          {
112                  rdpsnd_dsp_softvol(inbuffer, outbuffer, size, format);                  rdpsnd_dsp_softvol(outbuffer, size, format);
         }  
         else  
         {  
                 memcpy(outbuffer, inbuffer, size);  
113          }          }
114    
115          return outbuffer;          return outbuffer;

Legend:
Removed from v.1258  
changed lines
  Added in v.1259

  ViewVC Help
Powered by ViewVC 1.1.26