From 26def946940090176dadb4bba09e0a13553a4d2a Mon Sep 17 00:00:00 2001 From: Louis-Francis Ratté-Boulianne Date: Fri, 10 Sep 2010 18:13:46 -0400 Subject: Only set remote candidates once the user accepted the call --- butterfly/channel/media.py | 2 ++ butterfly/media/stream_handler.py | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/butterfly/channel/media.py b/butterfly/channel/media.py index e18bb80..d75aad8 100644 --- a/butterfly/channel/media.py +++ b/butterfly/channel/media.py @@ -161,6 +161,8 @@ class ButterflyMediaChannel( if handle == int(self.GetSelfHandle()): if self.GetSelfHandle() in self._local_pending: self._call.accept() + for handler in self._session_handler.ListStreams(): + handler.send_candidates() def RemoveMembers(self, handles, message): logger.info("Remove members %r: %s" % (handles, message)) diff --git a/butterfly/media/stream_handler.py b/butterfly/media/stream_handler.py index f4b4ead..e420fec 100644 --- a/butterfly/media/stream_handler.py +++ b/butterfly/media/stream_handler.py @@ -142,8 +142,6 @@ class ButterflyStreamHandler ( is_webcam = (self._session.type is MediaSessionType.WEBCAM_SEND or self._session.type is MediaSessionType.WEBCAM_RECV) - if self._remote_candidates: - self.SetRemoteCandidateList(self._remote_candidates) if self._remote_codecs: self.SetRemoteCodecs(self._remote_codecs) @@ -155,6 +153,10 @@ class ButterflyStreamHandler ( if self.created_locally or is_webcam: self.SetLocalCodecs(codecs) + def send_candidates(self): + if self._remote_candidates and not self.created_locally: + self.SetRemoteCandidateList(self._remote_candidates) + def StreamState(self, state): logger.info("Stream %i state changed to %i" % (self._id, state)) self._state = state -- cgit v1.2.3