diff ALmixer.c @ 77:40078d025b73

Fixed stupid inverted logic bug with ALMIXER_DISABLE_PREDECODED_PRECOMPUTE_BUFFER_SIZE_OPTIMIZATION. I meant for this optimization to be on by default, but it was off. I noticed really slow loading for loadSound on a 5 min mp3 file on Android. (Nobody should be doing this.) The default was hitting the 1k buffer size. I decided to up the default to 4k, but now that the optimization is enabled, it generally won't be hit.
author Eric Wing <ewing@coronalabs.com>
date Mon, 13 Aug 2012 16:11:30 -0700
parents 609d597b0dd9
children 358b0bd5df43
line wrap: on
line diff
--- a/ALmixer.c	Mon Aug 13 01:40:17 2012 -0700
+++ b/ALmixer.c	Mon Aug 13 16:11:30 2012 -0700
@@ -799,7 +799,7 @@
 } /* End Compute_Total_Time */
 	
 
-#ifdef ALMIXER_DISABLE_PREDECODED_PRECOMPUTE_BUFFER_SIZE_OPTIMIZATION
+#ifndef ALMIXER_DISABLE_PREDECODED_PRECOMPUTE_BUFFER_SIZE_OPTIMIZATION
 static size_t Compute_Total_Bytes_Decomposed(ALuint bytes_per_sample, ALuint frequency, ALubyte channels, ALuint total_msec)
 {
 	double total_sec;
@@ -8371,7 +8371,7 @@
 	/* User requested decode all (easy, nothing to figure out) */
 	else if(AL_TRUE == decode_mode_is_predecoded)
 	{
-#ifdef ALMIXER_DISABLE_PREDECODED_PRECOMPUTE_BUFFER_SIZE_OPTIMIZATION
+#ifndef ALMIXER_DISABLE_PREDECODED_PRECOMPUTE_BUFFER_SIZE_OPTIMIZATION
 		/* SDL_sound (behind the scenes) seems to loop on buffer_size chunks 
 		 * until the buffer is filled. It seems like we can 
 		 * do much better and precompute the size of the buffer