aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2015-09-12 13:35:57 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2015-09-12 13:35:57 +0200
commitf10e97c7664ca2b3c514b3c27172b3561e860ffa (patch)
tree486807befe9b487017316923f2f702bf816bf3ae /bin
parent3d81ff92c78260bacb3ce0530e59581de71967c6 (diff)
downloadsynthpod-f10e97c7664ca2b3c514b3c27172b3561e860ffa.tar.xz
add condition to check for alsa channel overflow.
Diffstat (limited to 'bin')
-rw-r--r--bin/synthpod_alsa.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/synthpod_alsa.c b/bin/synthpod_alsa.c
index e98f5705..e9c3cff4 100644
--- a/bin/synthpod_alsa.c
+++ b/bin/synthpod_alsa.c
@@ -100,6 +100,7 @@ _rt_thread(void *data, Eina_Thread thread)
const uint32_t nsamples = handle->frsize;
const size_t sample_buf_size = sizeof(float) * nsamples;
int nplay = pcmi_nplay(pcmi);
+ int ncapt = pcmi_ncapt(pcmi);
int play_num;
int capt_num;
@@ -126,7 +127,7 @@ _rt_thread(void *data, Eina_Thread thread)
pcmi_capt_init(pcmi, nsamples);
capt_num = 0;
for(const sp_app_system_source_t *source=sources;
- source->type != SYSTEM_PORT_NONE;
+ (source->type != SYSTEM_PORT_NONE) && (capt_num < ncapt);
source++)
{
chan_t *chan = source->sys_port;
@@ -243,7 +244,7 @@ _rt_thread(void *data, Eina_Thread thread)
pcmi_play_init(pcmi, nsamples);
play_num = 0;
for(const sp_app_system_sink_t *sink=sinks;
- sink->type != SYSTEM_PORT_NONE;
+ (sink->type != SYSTEM_PORT_NONE) && (play_num < nplay);
sink++)
{
chan_t *chan = sink->sys_port;