summaryrefslogtreecommitdiff
path: root/apps/examples/i2schar/i2schar_receiver.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/examples/i2schar/i2schar_receiver.c')
-rw-r--r--apps/examples/i2schar/i2schar_receiver.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/examples/i2schar/i2schar_receiver.c b/apps/examples/i2schar/i2schar_receiver.c
index 40256d571..279076c6a 100644
--- a/apps/examples/i2schar/i2schar_receiver.c
+++ b/apps/examples/i2schar/i2schar_receiver.c
@@ -94,6 +94,7 @@ pthread_addr_t i2schar_receiver(pthread_addr_t arg)
struct audio_buf_desc_s desc;
int bufsize;
int nread;
+ int ret;
int fd;
int i;
@@ -117,15 +118,17 @@ pthread_addr_t i2schar_receiver(pthread_addr_t arg)
desc.numbytes = CONFIG_EXAMPLES_I2SCHAR_BUFSIZE;
desc.u.ppBuffer = &apb;
- bufsize = apb_alloc(&desc);
- if (bufsize < 0)
+ ret = apb_alloc(&desc);
+ if (ret < 0)
{
message("i2schar_receiver: ERROR: failed to allocate buffer %d: %d\n",
- i+1, bufsize);
+ i+1, ret);
close(fd);
pthread_exit(NULL);
}
+ bufsize = sizeof(struct ap_buffer_s) + CONFIG_EXAMPLES_I2SCHAR_BUFSIZE;
+
/* Then receifve into the buffer */
do