summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-09-10 18:13:46 -0400
committerLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-09-10 18:13:46 -0400
commit26def946940090176dadb4bba09e0a13553a4d2a (patch)
tree554abb21fc8f2fdad2843c2574698e4efb3b76dc
parent65a00f77f4fed2535ff9b593d5f35ba413ef78a7 (diff)
Only set remote candidates once the user accepted the call
-rw-r--r--butterfly/channel/media.py2
-rw-r--r--butterfly/media/stream_handler.py6
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