summaryrefslogtreecommitdiff
path: root/psdl.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-07-28 15:36:22 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-07-28 15:36:22 +0200
commit6beba9ee559fe372fcd997835441bcf94e8d3502 (patch)
treebeafa3ede81b00793248e5dd1d083113dda9785c /psdl.c
parent5ead039965dc3d58466f982ab3eb8680e69a269c (diff)
added some preventive byteswapping for bigendian support in the future
Diffstat (limited to 'psdl.c')
-rw-r--r--psdl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/psdl.c b/psdl.c
index 04975b79..1ffa21ca 100644
--- a/psdl.c
+++ b/psdl.c
@@ -1,6 +1,7 @@
#include <SDL/SDL.h>
#include "psdl.h"
#include "streamer.h"
+#include "common.h"
static int sdl_player_numsamples = 4096;
int sdl_player_freq;
@@ -88,7 +89,7 @@ psdl_callback (void* userdata, Uint8 *stream, int len) {
int ivolume = sdl_volume * 1000;
for (int i = 0; i < bytesread/2; i++) {
int16_t sample = (int16_t)(((int32_t)(((int16_t*)stream)[i])) * ivolume / 1000);
- ((int16_t*)stream)[i] = sample;
+ le_int16 (sample, (char*)&(((int16_t*)stream)[i]));
}
if (bytesread < len) {
memset (stream + bytesread, 0, len-bytesread);