mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-28 03:18:55 +08:00
Output proper 16-bit sound (fixes decoding on PPC)
Originally committed as revision 7000 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -484,10 +484,13 @@ static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data,
|
|||||||
} else {
|
} else {
|
||||||
if (s->bits == 16)
|
if (s->bits == 16)
|
||||||
vmdaudio_decode_audio(s, data, buf, 1);
|
vmdaudio_decode_audio(s, data, buf, 1);
|
||||||
else
|
else {
|
||||||
/* copy the data but convert it to signed */
|
/* copy the data but convert it to signed */
|
||||||
for (i = 0; i < s->block_align; i++)
|
for (i = 0; i < s->block_align; i++){
|
||||||
data[i * 2 + 1] = buf[i] + 0x80;
|
*data++ = buf[i] + 0x80;
|
||||||
|
*data++ = buf[i] + 0x80;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bytes_decoded = s->block_align * 2;
|
bytes_decoded = s->block_align * 2;
|
||||||
@ -500,8 +503,10 @@ static int vmdaudio_loadsound(VmdAudioContext *s, unsigned char *data,
|
|||||||
vmdaudio_decode_audio(s, data, buf, 0);
|
vmdaudio_decode_audio(s, data, buf, 0);
|
||||||
} else {
|
} else {
|
||||||
/* copy the data but convert it to signed */
|
/* copy the data but convert it to signed */
|
||||||
for (i = 0; i < s->block_align; i++)
|
for (i = 0; i < s->block_align; i++){
|
||||||
data[i * 2 + 1] = buf[i] + 0x80;
|
*data++ = buf[i] + 0x80;
|
||||||
|
*data++ = buf[i] + 0x80;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user