summaryrefslogtreecommitdiff
path: root/apps/tdspeed.c
diff options
context:
space:
mode:
authorSteve Bavin <pondlife@pondlife.me>2009-06-15 15:46:09 +0000
committerSteve Bavin <pondlife@pondlife.me>2009-06-15 15:46:09 +0000
commit77f6f4caadfab255eed4d4cfbd471cb981ccb073 (patch)
tree9f4893b5e5b21763e9dbe9c449c34ca06ae3e7b4 /apps/tdspeed.c
parent3391bf3543876205c253544aa5ba42140b7d8ad0 (diff)
Fix FS#10331 and get mpegplayer working again.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21293 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tdspeed.c')
-rw-r--r--apps/tdspeed.c18
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;
static int32_t *overlap_buffer[2] = { NULL, NULL };
static int32_t *outbuf[2] = { NULL, NULL };
-bool tdspeed_init(int samplerate, bool stereo, int factor)
+void tdspeed_init()
{
- struct tdspeed_state_s *st = &tdspeed_state;
- int src_frame_sz;
-
/* Allocate buffers */
if (overlap_buffer[0] == NULL)
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)
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));
+}
+
+
+bool tdspeed_config(int samplerate, bool stereo, int factor)
+{
+ struct tdspeed_state_s *st = &tdspeed_state;
+ int src_frame_sz;
+
+ /* Check buffers were allocated ok */
+ if (overlap_buffer[0] == NULL || overlap_buffer[1] == NULL)
+ return false;
+ if (outbuf[0] == NULL || outbuf[1] == NULL)
+ return false;
/* Check parameters */
if (factor == 100)