patch-esd_c 756 B

1234567891011121314151617181920212223
  1. $Id$
  2. cast to double, to avoid sinf, patch from Sven Gugges
  3. --- esound-0.2.38.orig/esd.c 2007-05-03 22:28:35.000000000 +0200
  4. +++ esound-0.2.38/esd.c 2007-05-19 17:21:23.000000000 +0200
  5. @@ -131,14 +131,14 @@ void set_audio_buffer( void *buf, esd_fo
  6. {
  7. case ESD_BITS8:
  8. for ( i = 0 ; i < length ; i+=2 ) {
  9. - sample = sin( (float)(i+offset) * kf );
  10. + sample = sin( (double)(i+offset) * kf );
  11. uc_buf[i] = 127 + magl * sample;
  12. uc_buf[i+1] = 127 + magr * sample;
  13. }
  14. break;
  15. case ESD_BITS16: /* assume same endianness */
  16. for ( i = 0 ; i < length ; i+=2 ) {
  17. - sample = sin( (float)(i+offset) * kf );
  18. + sample = sin( (double)(i+offset) * kf );
  19. ss_buf[i] = magl * sample;
  20. ss_buf[i+1] = magr * sample;
  21. }