Index: apps/pcmbuf.c =================================================================== --- apps/pcmbuf.c (revision 22246) +++ apps/pcmbuf.c (working copy) @@ -91,11 +91,13 @@ /* Track the current location for processing crossfade */ static struct pcmbufdesc *crossfade_chunk IDATA_ATTR; +#if MEMORYSIZE > 2 static size_t crossfade_sample IDATA_ATTR; /* Counters for fading in new data */ static size_t crossfade_fade_in_total IDATA_ATTR; static size_t crossfade_fade_in_rem IDATA_ATTR; +#endif static struct pcmbufdesc *pcmbuf_read IDATA_ATTR; static struct pcmbufdesc *pcmbuf_read_end IDATA_ATTR; @@ -543,6 +545,11 @@ return false; } +/** + * Low memory targets don't have crossfade, so don't compile crossfade + * specific code in order to save some memory. */ + +#if MEMORYSIZE > 2 /** * Completely process the crossfade fade out effect with current pcm buffer. */ @@ -824,6 +831,7 @@ } } +#endif static bool prepare_insert(size_t length) { @@ -862,8 +870,10 @@ void* pcmbuf_request_buffer(int *count) { +#if MEMORYSIZE > 2 if (crossfade_init) crossfade_start(); +#endif if (crossfade_active) { *count = MIN(*count, PCMBUF_MIX_CHUNK/4); @@ -929,7 +939,7 @@ void pcmbuf_write_complete(int count) { size_t length = (size_t)(unsigned int)count << 2; - +#if MEMORYSIZE > 2 if (crossfade_active) { flush_crossfade(fadebuf, length); @@ -937,6 +947,7 @@ crossfade_active = false; } else +#endif { audiobuffer_fillpos += length;