patch-esd_c 756 B

1234567891011121314151617181920212223
  1. $Id$
  2. cast to double, to avoid sinf, patch from Sven Gugges
  3. --- esound-0.2.41.orig/esd.c 2008-11-18 21:35:19.000000000 +0100
  4. +++ esound-0.2.41/esd.c 2011-01-14 23:15:33.000000000 +0100
  5. @@ -134,14 +134,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. }