musicpal: Fix output level of 8-bit samples (Jan Kiszka).
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4269 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
7546c016e5
commit
aa92310171
|
@ -270,15 +270,15 @@ static void audio_callback(void *opaque, int free_out, int free_in)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (s->playback_mode & MP_AUDIO_16BIT_SAMPLE)
|
if (s->playback_mode & MP_AUDIO_16BIT_SAMPLE)
|
||||||
memcpy(wm8750_dac_buffer(s->wm, block_size >> 2),
|
memcpy(wm8750_dac_buffer(s->wm, block_size >> 2),
|
||||||
(uint32_t *)(s->target_buffer + s->play_pos),
|
(uint32_t *)(s->target_buffer + s->play_pos),
|
||||||
block_size);
|
block_size);
|
||||||
else {
|
else {
|
||||||
codec_buffer = wm8750_dac_buffer(s->wm, block_size >> 1);
|
codec_buffer = wm8750_dac_buffer(s->wm, block_size >> 1);
|
||||||
for (pos = 0; pos < block_size; pos += 2) {
|
for (pos = 0; pos < block_size; pos += 2) {
|
||||||
*codec_buffer++ = cpu_to_le16(2 *
|
*codec_buffer++ = cpu_to_le16(256 *
|
||||||
*(int8_t *)(s->target_buffer + s->play_pos + pos));
|
*(int8_t *)(s->target_buffer + s->play_pos + pos));
|
||||||
*codec_buffer++ = cpu_to_le16(2 *
|
*codec_buffer++ = cpu_to_le16(256 *
|
||||||
*(int8_t *)(s->target_buffer + s->play_pos + pos + 1));
|
*(int8_t *)(s->target_buffer + s->play_pos + pos + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue