Move lock above initialization of self.frame

This commit is contained in:
Wouter Heerwegh
2023-05-31 10:10:12 +02:00
committed by GitHub
parent c10bcc3fe0
commit 2df8518ca6

View File

@@ -1032,9 +1032,9 @@ class BackgroundFrameRead:
def __init__(self, tello, address, with_queue = False, maxsize = 32):
self.address = address
self.lock = Lock()
self.frame = np.zeros([300, 400, 3], dtype=np.uint8)
self.frames = deque([], maxsize)
self.lock = Lock()
self.with_queue = with_queue
# Try grabbing frame with PyAV