1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added workarounds for an internal compiler error bug on armeabi Android

This commit is contained in:
hogliux 2017-03-08 10:23:13 +00:00
parent 279c4bc4db
commit 80a226204a
2 changed files with 15 additions and 0 deletions

View file

@ -1922,9 +1922,16 @@ long ov_read_filter(OggVorbis_File *vf,char *buffer,int length,
vorbis_fpu_setround(&fpu);
for(j=0;j<samples;j++)
for(i=0;i<channels;i++){
// Workaround for an ndk armeabi compiler bug which crashes on signed saturation
#ifdef ANDROID
float f = pcm[i][j];
f = (f <= 1.0f ? (f >= -1.0f ? f : -1.0f) : 1.0f);
val = vorbis_ftoi(f * 128.f);
#else
val=vorbis_ftoi(pcm[i][j]*128.f);
if(val>127)val=127;
else if(val<-128)val=-128;
#endif
*buffer++=val+off;
}
vorbis_fpu_restore(fpu);