From b84c10f838fd23b1690865e8f59be75790fdd30a Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 14 Aug 2020 12:14:54 +0900 Subject: [PATCH] Added time.sleeps to non blocking while loops to lower CPU requirements. --- pyVoIP/RTP.py | 14 ++++++++++---- pyVoIP/SIP.py | 4 ++-- pyVoIP/VoIP.py | 20 ++++++++++---------- pyVoIP/__init__.py | 2 +- 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/pyVoIP/RTP.py b/pyVoIP/RTP.py index c68adaa..6e5bab7 100644 --- a/pyVoIP/RTP.py +++ b/pyVoIP/RTP.py @@ -112,7 +112,7 @@ def __init__(self): def read(self, length=160): while self.rebuilding: #This acts functionally as a lock while the buffer is being rebuilt. - print("Rebuilding") + time.sleep(0.01) self.bufferLock.acquire() packet = self.buffer.read(length) if len(packet)