aboutsummaryrefslogtreecommitdiff
path: root/sio.c
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2014-09-17 21:51:03 +0000
committerDimitri Sokolyuk <demon@dim13.org>2014-09-17 21:51:03 +0000
commit3408ce19b34c50ae566f52d3dad7638c41ae6dcd (patch)
tree445eb4c90d296bc6276c18ad9fb045457198766d /sio.c
parenta9799dc301aa6a8638d634e722ed730666878067 (diff)
push data into widget
Diffstat (limited to 'sio.c')
-rw-r--r--sio.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/sio.c b/sio.c
index 43ffcd6..7104e9a 100644
--- a/sio.c
+++ b/sio.c
@@ -63,25 +63,18 @@ init_sio(void)
errx(1, "unsupported audio params");
samples = par.rate / FPS;
- samples -= samples % par.round - par.round;
+ samples -= samples % par.round;
buffer = calloc(samples * par.rchan, sizeof(int16_t));
assert(buffer);
- return sio_start(hdl);
-}
+ warnx("%d, %d, %d", samples, par.rate, par.round);
+
+ sio_start(hdl);
-unsigned int
-max_samples_sio(void)
-{
- /*
- * maximal number of samples we're willing to provide
- * with 1920 at 25 fps and 48000 Hz or
- * with 1764 at 25 fps and 44100 Hz it shall fit on most screens
- */
return samples;
}
-void
+size_t
read_sio(double *left, double *right, size_t n)
{
int done, i;
@@ -109,6 +102,8 @@ read_sio(double *left, double *right, size_t n)
left[i] = data[i].left;
right[i] = data[i].right;
}
+
+ return n;
}
void