Mercurial > almixer_isolated
changeset 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 | 12e4e093c6e0 |
children | 714ec6c5789d |
files | ALmixer.c ALmixer.h |
diffstat | 2 files changed, 3 insertions(+), 3 deletions(-) [+] |
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
--- a/ALmixer.h Mon Aug 13 01:40:17 2012 -0700 +++ b/ALmixer.h Mon Aug 13 16:11:30 2012 -0700 @@ -510,7 +510,7 @@ * However, if my attempts fail for some reason, this buffer size becomes a fallback. * Having too small of a buffer might cause performance bottlenecks. */ - #define ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE 1024 + #define ALMIXER_DEFAULT_PREDECODED_BUFFERSIZE 4096 #endif /**