diff options
Diffstat (limited to 'apps/tdspeed.c')
-rw-r--r-- | apps/tdspeed.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/apps/tdspeed.c b/apps/tdspeed.c index 67f749f6c3..f365e95e03 100644 --- a/apps/tdspeed.c +++ b/apps/tdspeed.c | |||
@@ -54,11 +54,8 @@ static struct tdspeed_state_s tdspeed_state; | |||
54 | static int32_t *overlap_buffer[2] = { NULL, NULL }; | 54 | static int32_t *overlap_buffer[2] = { NULL, NULL }; |
55 | static int32_t *outbuf[2] = { NULL, NULL }; | 55 | static int32_t *outbuf[2] = { NULL, NULL }; |
56 | 56 | ||
57 | bool tdspeed_init(int samplerate, bool stereo, int factor) | 57 | void tdspeed_init() |
58 | { | 58 | { |
59 | struct tdspeed_state_s *st = &tdspeed_state; | ||
60 | int src_frame_sz; | ||
61 | |||
62 | /* Allocate buffers */ | 59 | /* Allocate buffers */ |
63 | if (overlap_buffer[0] == NULL) | 60 | if (overlap_buffer[0] == NULL) |
64 | overlap_buffer[0] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t)); | 61 | overlap_buffer[0] = (int32_t *) buffer_alloc(FIXED_BUFSIZE * sizeof(int32_t)); |
@@ -68,6 +65,19 @@ bool tdspeed_init(int samplerate, bool stereo, int factor) | |||
68 | outbuf[0] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); | 65 | outbuf[0] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); |
69 | if (outbuf[1] == NULL) | 66 | if (outbuf[1] == NULL) |
70 | outbuf[1] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); | 67 | outbuf[1] = (int32_t *) buffer_alloc(TDSPEED_OUTBUFSIZE * sizeof(int32_t)); |
68 | } | ||
69 | |||
70 | |||
71 | bool tdspeed_config(int samplerate, bool stereo, int factor) | ||
72 | { | ||
73 | struct tdspeed_state_s *st = &tdspeed_state; | ||
74 | int src_frame_sz; | ||
75 | |||
76 | /* Check buffers were allocated ok */ | ||
77 | if (overlap_buffer[0] == NULL || overlap_buffer[1] == NULL) | ||
78 | return false; | ||
79 | if (outbuf[0] == NULL || outbuf[1] == NULL) | ||
80 | return false; | ||
71 | 81 | ||
72 | /* Check parameters */ | 82 | /* Check parameters */ |
73 | if (factor == 100) | 83 | if (factor == 100) |