/[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 1285 by stargo, Sun Oct 1 18:22:05 2006 UTC revision 1287 by stargo, Sun Oct 1 19:05:30 2006 UTC
# Line 278  rdpsnd_dsp_resample(unsigned char **out, Line 278  rdpsnd_dsp_resample(unsigned char **out,
278          for (i = 0; i < outsize / (resample_to_channels * samplewidth); i++)          for (i = 0; i < outsize / (resample_to_channels * samplewidth); i++)
279          {          {
280                  int source = ((i * 1000) + ratio1k - 1000) / (ratio1k + 1);                  int source = ((i * 1000) + ratio1k - 1000) / (ratio1k + 1);
281                    int j;
282    
283                  if (source * resample_to_channels + samplewidth > size)                  if (source * resample_to_channels + samplewidth > size)
284                          break;                          break;
285    
286                  if (resample_to_channels == 2)                  for (j = 0; j < resample_to_channels; j++)
287                  {                  {
288                          memcpy(*out + (i * resample_to_channels * samplewidth),                          memcpy(*out + (i * resample_to_channels * samplewidth) + (samplewidth * j),
289                                 in + (source * resample_to_channels * samplewidth), samplewidth);                                          in + (source * resample_to_channels * samplewidth) + (samplewidth * j),
290                          memcpy(*out + (i * resample_to_channels * samplewidth) + samplewidth,                                          samplewidth);
                                in + (source * resample_to_channels * samplewidth) + samplewidth,  
                                samplewidth);  
                 }  
                 else  
                 {  
                         memcpy(*out + (i * samplewidth), in + (source * samplewidth), samplewidth);  
291                  }                  }
292          }          }
293          outsize = i * resample_to_channels * samplewidth;          outsize = i * resample_to_channels * samplewidth;

Legend:
Removed from v.1285  
changed lines
  Added in v.1287

  ViewVC Help
Powered by ViewVC 1.1.26