summaryrefslogtreecommitdiff
path: root/apps/mixer.c
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2015-10-12 03:05:28 +0200
committerChristian Pointner <equinox@spreadspace.org>2015-10-12 03:05:28 +0200
commitb5cbc933c90ce8d5e34a7bce3e7c500e41f6e243 (patch)
treec9cd570ed926b4a65de33fbea1135647b45dbfac /apps/mixer.c
parenttriggering language switch using midi works (diff)
language specific done data
Diffstat (limited to 'apps/mixer.c')
-rw-r--r--apps/mixer.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/mixer.c b/apps/mixer.c
index 78a0d29..50684ca 100644
--- a/apps/mixer.c
+++ b/apps/mixer.c
@@ -121,7 +121,6 @@ int mixer_init(mixer_t* x, const char* name, const char* device)
x->name_ = name;
x->output_ = NULL;
- x->pfd_count_ = 0;
slist_init(&(x->langs_), free_lang_entry);
slist_init(&(x->tasks_), free_task_entry);
int ret = snd_rawmidi_open(NULL, &(x->output_), device, SND_RAWMIDI_NONBLOCK);
@@ -223,19 +222,18 @@ void mixer_print_tasks(mixer_t* x)
int mixer_get_poll_fd_count(mixer_t* x)
{
- return (x->pfd_count_ = snd_rawmidi_poll_descriptors_count(x->output_));
+ return snd_rawmidi_poll_descriptors_count(x->output_);
}
int mixer_get_poll_fds(mixer_t* x, struct pollfd *pfds, int npfds)
{
- if(slist_length(&(x->tasks_)))
- return snd_rawmidi_poll_descriptors(x->output_, pfds, npfds);
- else {
+ int ret = snd_rawmidi_poll_descriptors(x->output_, pfds, npfds);
+ if(!slist_length(&(x->tasks_))) {
int i;
- for(i = 0; i < x->pfd_count_; ++i)
+ for(i = 0; i < ret; ++i)
pfds[i].fd = -1;
}
- return x->pfd_count_;
+ return ret;
}
int mixer_handle_revents(mixer_t* x, struct pollfd *pfds, int npfds)