regainplay_analysis : Work around GCC optimizer bug.

Discussion: http://lists.xiph.org/pipermail/flac-dev/2014-June/004720.html
Patch-from: lvqcl <lvqcl.mail@gmail.com>
This commit is contained in:
Erik de Castro Lopo
2014-06-15 20:32:45 +10:00
parent b8d58e327c
commit 19b549f82f

View File

@@ -536,7 +536,11 @@ analyzeResult ( Uint32_t* Array, size_t len )
if ( elems == 0 )
return GAIN_NOT_ENOUGH_SAMPLES;
#if 0 /* GCC bug workaround: it incorrectly calculates 'elems * (1. - RMS_PERCENTILE)' with -O3 -msse2 ... options */
upper = (Int32_t) ceil (elems * (1. - RMS_PERCENTILE));
#else
upper = (Int32_t) (elems / 20 + ((elems % 20) ? 1 : 0));
#endif
for ( i = len; i-- > 0; ) {
if ( (upper -= Array[i]) <= 0 )
break;