diff options
| author | Thomas Martitz <kugel@rockbox.org> | 2009-06-16 00:59:24 +0000 |
|---|---|---|
| committer | Thomas Martitz <kugel@rockbox.org> | 2009-06-16 00:59:24 +0000 |
| commit | cb57a568e8dc9def607dc9ab27f515309bd13841 (patch) | |
| tree | 45e01c7b2d8b15c6c8fbaef8139d097c95df7e92 /apps/tdspeed.c | |
| parent | 3866755d28f35bdaf29147799009b1d0ac89d1d7 (diff) | |
| download | rockbox-cb57a568e8dc9def607dc9ab27f515309bd13841.zip rockbox-cb57a568e8dc9def607dc9ab27f515309bd13841.tar.gz rockbox-cb57a568e8dc9def607dc9ab27f515309bd13841.tar.bz2 rockbox-cb57a568e8dc9def607dc9ab27f515309bd13841.tar.xz | |
Get rid of tdspeed_enabled in struct dsp_config and use the global_settings member instead. That one needs to be checked in tdspeed_init() as well, else the buffers are always allocated.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21305 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tdspeed.c')
| -rw-r--r-- | apps/tdspeed.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/apps/tdspeed.c b/apps/tdspeed.c index f365e95..501c1d8 100644 --- a/apps/tdspeed.c +++ b/apps/tdspeed.c @@ -28,6 +28,7 @@ #include "debug.h" #include "system.h" #include "tdspeed.h" +#include "settings.h" #define assert(cond) @@ -56,15 +57,18 @@ static int32_t *outbuf[2] = { NULL, NULL }; void tdspeed_init() { - /* Allocate buffers */ - if (overlap_buffer[0] == NULL) - overlap_buffer[0] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t)); - if (overlap_buffer[1] == NULL) - overlap_buffer[1] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t)); - if (outbuf[0] == NULL) - outbuf[0] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); - if (outbuf[1] == NULL) - outbuf[1] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); + if (global_settings.timestretch_enabled) + { + /* Allocate buffers */ + if (overlap_buffer[0] == NULL) + overlap_buffer[0] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t)); + if (overlap_buffer[1] == NULL) + overlap_buffer[1] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t)); + if (outbuf[0] == NULL) + outbuf[0] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); + if (outbuf[1] == NULL) + outbuf[1] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); + } } @@ -327,3 +331,4 @@ int tdspeed_doit(int32_t *src[], int count) src[1] = outbuf[1]; return count; } + |