summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJari Vetoniemi <mailroxas@gmail.com>2018-10-31 10:17:26 +0200
committerJari Vetoniemi <mailroxas@gmail.com>2018-10-31 10:17:26 +0200
commit28452717ad1ee7dc817506358240fa9dcde392ea (patch)
tree50982f4ecda09a28f89973facc06d8b93d9e9bef
parent90dbf051d147d9bc73f3eea43ba403557da70d5f (diff)
remove the pollin hacks
just modifying elem in setters is enough
-rw-r--r--src/mixer.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/mixer.c b/src/mixer.c
index 48b3882..67046e6 100644
--- a/src/mixer.c
+++ b/src/mixer.c
@@ -2,7 +2,6 @@
#include <sndio.h>
#include <stdbool.h>
#include <stdio.h>
-#include <time.h>
#include "util/sysex.h"
#include "util/util.h"
@@ -16,7 +15,6 @@ struct _snd_mixer_elem {
struct _snd_mixer {
struct mio_hdl *hdl;
snd_mixer_elem_t *controls;
- uint64_t last_pollin_time;
};
#define MIXER_MAX_CHANNELS 16
@@ -220,14 +218,6 @@ snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int
return mio_pollfd(mixer->hdl, pfds, POLLOUT | POLLIN);
}
-static uint64_t
-get_time_ns(void)
-{
- struct timespec ts;
- clock_gettime(CLOCK_MONOTONIC, &ts);
- return (uint64_t)ts.tv_sec * (uint64_t)1e9 + (uint64_t)ts.tv_nsec;
-}
-
int
snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
{
@@ -235,16 +225,6 @@ snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, unsi
return -1;
*revents = mio_revents(mixer->hdl, pfds);
-
- const uint64_t time = get_time_ns();
- if (!(*revents & POLLIN)) {
- if (((time - mixer->last_pollin_time) / 1e6) > 20)
- *revents |= POLLIN;
- }
-
- if (*revents & POLLIN)
- mixer->last_pollin_time = time;
-
return 0;
}