def __init__(self, source_group, player): super(SilentAudioPlayerPacketConsumer, self).__init__(source_group, player) # System time of first timestamp self._timestamp_time = None # List of buffered SilentAudioPacket self._packets = [] self._packets_duration = 0 self._events = [] # Actual play state. self._playing = False # TODO Be nice to avoid creating this thread if user doesn't care # about EOS events and there's no video format. # NOTE Use thread.condition as lock for all instance vars used by worker self._thread = MediaThread(target=self._worker_func) if source_group.audio_format: self._thread.start()