Changeset 854:3f08ff528e51 in roaraudio


Ignore:
Timestamp:
09/28/08 22:56:39 (16 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support for 32bit mixing if we have a 64bit type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/mixer.c

    r668 r854  
    105105 
    106106int mix_clients_32bit (void * output, void ** input, int samples) { 
    107 /* 
     107#ifdef ROAR_NATIVE_INT64 
    108108 int i, s; 
    109  int c; 
     109 ROAR_NATIVE_INT64 c; 
    110110 
    111111 for (s = 0; s < samples; s++) { 
     
    113113 
    114114  for (i = 0; input[i]; i++) 
    115    c += ((int**)input)[i][s]; 
    116  
    117   if ( c > 127 ) 
    118    c = 127; 
    119   else if ( c < -128 ) 
    120    c = -128; 
     115   c += ((ROAR_NATIVE_INT64**)input)[i][s]; 
     116 
     117  if ( c > 21474836487LL ) 
     118   c = 2147483647LL; 
     119  else if ( c < -2147483648LL ) 
     120   c = -2147483648LL; 
    121121  ((int*)output)[s] = (char)c; 
    122122 } 
    123123 
    124  return 0; 
    125 */ 
    126  return 1; 
     124 return  0; 
     125#else 
     126 return -1; 
     127#endif 
    127128} 
    128129 
Note: See TracChangeset for help on using the changeset viewer.