changeset 5e5b49871ae2 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=5e5b49871ae2
description: fix order of farstream calls
diffstat:
src/common/jingle_rtp.py | 23 ++++++++++++++++++-----
1 files changed, 18 insertions(+), 5 deletions(-)
diffs (40 lines):
diff -r ef9f5c22d2c2 -r 5e5b49871ae2 src/common/jingle_rtp.py
--- a/src/common/jingle_rtp.py Wed Dec 26 18:41:31 2012 -0400
+++ b/src/common/jingle_rtp.py Sun Dec 30 16:20:57 2012 +0100
@@ -177,6 +177,15 @@
elif name == 'farstream-codecs-changed':
if self.sent and self.p2psession.get_property('codecs'):
self.send_description_info()
+ if self.transport.remote_candidates:
+ # those lines MUST be done after we get info on our
+ # codecs
+ self.p2pstream.add_remote_candidates(
+ self.transport.remote_candidates)
+ self.transport.remote_candidates = []
+ self.p2pstream.set_property('direction',
+ farstream.DIRECTION_BOTH)
+
elif name == 'farstream-local-candidates-prepared':
self.candidates_ready = True
if self.is_ready():
@@ -234,11 +243,15 @@
def on_negotiated(self):
if self.accepted:
- if self.transport.remote_candidates:
- self.p2pstream.add_remote_candidates(self.transport.remote_candidates)
- self.transport.remote_candidates = []
- # TODO: farstream.DIRECTION_BOTH only if senders='both'
- self.p2pstream.set_property('direction', farstream.DIRECTION_BOTH)
+ if self.p2psession.get_property('codecs'):
+ # those lines MUST be done after we get info on our codecs
+ if self.transport.remote_candidates:
+ self.p2pstream.add_remote_candidates(
+ self.transport.remote_candidates)
+ self.transport.remote_candidates = []
+ # TODO: farstream.DIRECTION_BOTH only if senders='both'
+ self.p2pstream.set_property('direction',
+ farstream.DIRECTION_BOTH)
JingleContent.on_negotiated(self)
def __on_remote_codecs(self, stanza, content, error, action):