ok
This commit is contained in:
@@ -38,6 +38,9 @@ class InputBuffer(threading.Thread):
|
||||
def interval():
|
||||
return .1
|
||||
|
||||
def sticky_duration():
|
||||
return 1
|
||||
|
||||
def stop(self):
|
||||
self.done = True
|
||||
self.q.put(None)
|
||||
@@ -124,8 +127,8 @@ class InputBuffer(threading.Thread):
|
||||
latest = b
|
||||
oldest = a
|
||||
if latest.v == None:
|
||||
t_a_few_intervals_ago = InputBuffer.now() - InputBuffer.interval() * 10
|
||||
if oldest.t > t_a_few_intervals_ago:
|
||||
a_few_t_ago = InputBuffer.now() - InputBuffer.sticky_duration()
|
||||
if oldest.t > a_few_t_ago:
|
||||
return oldest
|
||||
return latest
|
||||
|
||||
|
||||
Reference in New Issue
Block a user