Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix busy-loop in opus.py DecodeManager #1395

Merged
merged 3 commits into from
Jun 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Opus Decoder: only sleep if decode queue is empty
  • Loading branch information
nikolabura authored May 31, 2022
commit 25de46636cb68fb458e8800a98e24df76250215f
3 changes: 1 addition & 2 deletions discord/opus.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,11 +534,10 @@ def decode(self, opus_frame):

def run(self):
while not self._end_thread.is_set():
time.sleep(0.001)

try:
data = self.decode_queue.pop(0)
except IndexError:
time.sleep(0.001)
continue

try:
Expand Down