master
parent
52e9df34d3
commit
cbe790c90c
|
|
@ -38,6 +38,9 @@ class InputBuffer(threading.Thread):
|
||||||
def interval():
|
def interval():
|
||||||
return .1
|
return .1
|
||||||
|
|
||||||
|
def sticky_duration():
|
||||||
|
return 1
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.done = True
|
self.done = True
|
||||||
self.q.put(None)
|
self.q.put(None)
|
||||||
|
|
@ -124,8 +127,8 @@ class InputBuffer(threading.Thread):
|
||||||
latest = b
|
latest = b
|
||||||
oldest = a
|
oldest = a
|
||||||
if latest.v == None:
|
if latest.v == None:
|
||||||
t_a_few_intervals_ago = InputBuffer.now() - InputBuffer.interval() * 10
|
a_few_t_ago = InputBuffer.now() - InputBuffer.sticky_duration()
|
||||||
if oldest.t > t_a_few_intervals_ago:
|
if oldest.t > a_few_t_ago:
|
||||||
return oldest
|
return oldest
|
||||||
return latest
|
return latest
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue