Revision a350e694 hw/musicpal.c
b/hw/musicpal.c | ||
---|---|---|
244 | 244 |
uint32_t status; |
245 | 245 |
uint32_t irq_enable; |
246 | 246 |
unsigned long phys_buf; |
247 |
void *target_buffer;
|
|
247 |
int8_t *target_buffer;
|
|
248 | 248 |
unsigned int threshold; |
249 | 249 |
unsigned int play_pos; |
250 | 250 |
unsigned int last_free; |
... | ... | |
256 | 256 |
{ |
257 | 257 |
musicpal_audio_state *s = opaque; |
258 | 258 |
int16_t *codec_buffer; |
259 |
void *mem_buffer;
|
|
259 |
int8_t *mem_buffer;
|
|
260 | 260 |
int pos, block_size; |
261 | 261 |
|
262 | 262 |
if (!(s->playback_mode & MP_AUDIO_PLAYBACK_EN)) |
... | ... | |
277 | 277 |
if (s->playback_mode & MP_AUDIO_MONO) { |
278 | 278 |
codec_buffer = wm8750_dac_buffer(s->wm, block_size >> 1); |
279 | 279 |
for (pos = 0; pos < block_size; pos += 2) { |
280 |
*codec_buffer++ = *(uint16_t *)mem_buffer;
|
|
281 |
*codec_buffer++ = *(uint16_t *)mem_buffer;
|
|
280 |
*codec_buffer++ = *(int16_t *)mem_buffer; |
|
281 |
*codec_buffer++ = *(int16_t *)mem_buffer; |
|
282 | 282 |
mem_buffer += 2; |
283 | 283 |
} |
284 | 284 |
} else |
... | ... | |
288 | 288 |
if (s->playback_mode & MP_AUDIO_MONO) { |
289 | 289 |
codec_buffer = wm8750_dac_buffer(s->wm, block_size); |
290 | 290 |
for (pos = 0; pos < block_size; pos++) { |
291 |
*codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer);
|
|
292 |
*codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
|
|
291 |
*codec_buffer++ = cpu_to_le16(256 * *mem_buffer); |
|
292 |
*codec_buffer++ = cpu_to_le16(256 * *mem_buffer++); |
|
293 | 293 |
} |
294 | 294 |
} else { |
295 | 295 |
codec_buffer = wm8750_dac_buffer(s->wm, block_size >> 1); |
296 | 296 |
for (pos = 0; pos < block_size; pos += 2) { |
297 |
*codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
|
|
298 |
*codec_buffer++ = cpu_to_le16(256 * *(int8_t *)mem_buffer++);
|
|
297 |
*codec_buffer++ = cpu_to_le16(256 * *mem_buffer++); |
|
298 |
*codec_buffer++ = cpu_to_le16(256 * *mem_buffer++); |
|
299 | 299 |
} |
300 | 300 |
} |
301 | 301 |
} |
Also available in: Unified diff