summaryrefslogtreecommitdiff
path: root/apps/tdspeed.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tdspeed.c')
-rw-r--r--apps/tdspeed.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/apps/tdspeed.c b/apps/tdspeed.c
index f365e95e03..501c1d8aa9 100644
--- a/apps/tdspeed.c
+++ b/apps/tdspeed.c
@@ -28,6 +28,7 @@
28#include "debug.h" 28#include "debug.h"
29#include "system.h" 29#include "system.h"
30#include "tdspeed.h" 30#include "tdspeed.h"
31#include "settings.h"
31 32
32#define assert(cond) 33#define assert(cond)
33 34
@@ -56,15 +57,18 @@ static int32_t *outbuf[2] = { NULL, NULL };
56 57
57void tdspeed_init() 58void tdspeed_init()
58{ 59{
59 /* Allocate buffers */ 60 if (global_settings.timestretch_enabled)
60 if (overlap_buffer[0] == NULL) 61 {
61 overlap_buffer[0] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t)); 62 /* Allocate buffers */
62 if (overlap_buffer[1] == NULL) 63 if (overlap_buffer[0] == NULL)
63 overlap_buffer[1] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t)); 64 overlap_buffer[0] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t));
64 if (outbuf[0] == NULL) 65 if (overlap_buffer[1] == NULL)
65 outbuf[0] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); 66 overlap_buffer[1] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t));
66 if (outbuf[1] == NULL) 67 if (outbuf[0] == NULL)
67 outbuf[1] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); 68 outbuf[0] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t));
69 if (outbuf[1] == NULL)
70 outbuf[1] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t));
71 }
68} 72}
69 73
70 74
@@ -327,3 +331,4 @@ int tdspeed_doit(int32_t *src[], int count)
327 src[1] = outbuf[1]; 331 src[1] = outbuf[1];
328 return count; 332 return count;
329} 333}
334