Fix WM_DoGetOutput for big-endian machines

- Besides being little-endian centric, this bit shifting madness
  was unneccessary since the values were already clamped to a 16-bit
  range, so all we need to do is cast them to a short.
This commit is contained in:
Randy Heit 2015-12-28 20:51:53 -06:00
parent b1405921bf
commit ee46799d9e
1 changed files with 3 additions and 4 deletions

View File

@ -3744,10 +3744,9 @@ static int WM_DoGetOutput(midi * handle, char * buffer,
* Write to the buffer
* ===================
*/
(*buffer++) = left_mix & 0xff;
(*buffer++) = ((left_mix >> 8) & 0x7f) | ((left_mix >> 24) & 0x80);
(*buffer++) = right_mix & 0xff;
(*buffer++) = ((right_mix >> 8) & 0x7f) | ((right_mix >> 24) & 0x80);
((short *)buffer)[0] = (short)left_mix;
((short *)buffer)[1] = (short)right_mix;
buffer += 4;
}
_WM_Unlock(&mdi->lock);
return buffer_used;