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

View file

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