summaryrefslogtreecommitdiff
path: root/code/test/voip.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2017-08-10 21:02:16 +0200
committerUros Majstorovic <majstor@majstor.org>2017-08-10 21:02:16 +0200
commitcbba099541d27400ad45083a4b1102b86f9e8dea (patch)
treee260d7da3d07b4de0e989726917f08d23c55f70d /code/test/voip.c
parente9ced8e60689c6f46ac4fc31013b88f4c3f4fa80 (diff)
rbuffer almost implemented
Diffstat (limited to 'code/test/voip.c')
-rw-r--r--code/test/voip.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/code/test/voip.c b/code/test/voip.c
index 67e1afe..8c53d01 100644
--- a/code/test/voip.c
+++ b/code/test/voip.c
@@ -52,7 +52,7 @@ int a_open(char *dev_name, snd_pcm_t **handle, snd_pcm_hw_params_t **hw_params,
frame_size = *nchannels * (bits / 8);
*buf_size = frame_size * *frames;
- return 0;
+ return ECP_OK;
}
int a_prepare(snd_pcm_t *handle, snd_pcm_hw_params_t *hw_params, unsigned char *buf, snd_pcm_uframes_t frames) {
@@ -68,7 +68,7 @@ int a_prepare(snd_pcm_t *handle, snd_pcm_hw_params_t *hw_params, unsigned char *
for (i=0; i<fragments; i++) snd_pcm_writei(handle, buf, frames);
}
- return 0;
+ return ECP_OK;
}
opus_int32 a_read(snd_pcm_t *handle, unsigned char *buf, snd_pcm_uframes_t frames, OpusEncoder *enc, unsigned char *opus_buf, opus_int32 opus_size) {
@@ -121,6 +121,8 @@ int a_init(void) {
size = opus_decoder_get_size(nchannels);
opus_dec = malloc(size);
opus_decoder_init(opus_dec, sample_rate, nchannels);
+
+ return ECP_OK;
}
ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsigned char *p, ssize_t s) {
@@ -129,7 +131,7 @@ ssize_t handle_open_c(ECPConnection *conn, ecp_seq_t sq, unsigned char t, unsign
ecp_conn_handle_open(conn, t, p, s);
if (s < 0) {
printf("OPEN ERR:%ld\n", s);
- return 0;
+ return s;
}
a_init();