diff options
author | cbdev <cb@cbcdn.com> | 2018-03-25 15:13:23 +0200 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2018-03-25 15:13:23 +0200 |
commit | 323db724551f2e1908aa0341a5d2b6e03ce351ae (patch) | |
tree | 791d182966a17a742344738bd68396268aff4bb2 | |
parent | 9a70fb468c78706cabf62ede9b5a67b822129d91 (diff) | |
download | midimonster-323db724551f2e1908aa0341a5d2b6e03ce351ae.tar.gz midimonster-323db724551f2e1908aa0341a5d2b6e03ce351ae.tar.bz2 midimonster-323db724551f2e1908aa0341a5d2b6e03ce351ae.zip |
Actually fix interval calculation (Fixes #7)
-rw-r--r-- | backend.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -212,9 +212,11 @@ struct timeval backend_timeout(){ for(u = 0; u < nbackends; u++){ if(backends[u].interval){ res = backends[u].interval(); - if((res / 1000) <= secs){ + if((res / 1000) < secs){ secs = res / 1000; - if((res % 1000) < msecs){ + msecs = res % 1000; + } + else if(res / 1000 == secs && (res % 1000) < msecs){ msecs = res % 1000; } } |