From: Magnus H. <leg...@us...> - 2008-10-16 18:14:57
|
Update of /cvsroot/emacs-jabber/tox In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv10917 Modified Files: jabber-tox.el Log Message: "Refactor" generation of payload-type elements Index: jabber-tox.el =================================================================== RCS file: /cvsroot/emacs-jabber/tox/jabber-tox.el,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- jabber-tox.el 16 Oct 2008 18:10:30 -0000 1.13 +++ jabber-tox.el 16 Oct 2008 18:12:15 -0000 1.14 @@ -153,7 +153,28 @@ (fsm state-data) (let ((jc (plist-get state-data :jc)) (jid (plist-get state-data :jid)) - (sid (plist-get state-data :sid))) + (sid (plist-get state-data :sid)) + (payload-types (mapcar + (lambda (codec) + `(payload-type + ((id . ,(number-to-string (nth 0 codec))) + (name . ,(nth 1 codec)) + ;; (nth 2 codec) is media type; + ;; should we filter out + ;; non-audio codecs? then + ;; again, the value seems to be + ;; bogus... + (clockrate . ,(number-to-string (nth 3 codec))) + ,@(let ((channels (nth 4 codec))) + (unless (= channels 0) + `((channels . ,(number-to-string channels)))))) + ,@(mapcar + (lambda (param) + `(parameter + ((name . ,(nth 0 param)) + (value . ,(nth 1 param))))) + (nth 5 codec)))) + (plist-get state-data :our-codecs)))) (jabber-send-iq jc jid "set" `(jingle ((xmlns . ,jingle-ns) (action . "session-initiate") @@ -166,27 +187,7 @@ (description ((xmlns . ,jingle-rtp-ns) (media . "audio")) - ,@(mapcar - (lambda (codec) - `(payload-type - ((id . ,(number-to-string (nth 0 codec))) - (name . ,(nth 1 codec)) - ;; (nth 2 codec) is media type; - ;; should we filter out - ;; non-audio codecs? then - ;; again, the value seems to be - ;; bogus... - (clockrate . ,(number-to-string (nth 3 codec))) - ,@(let ((channels (nth 4 codec))) - (unless (= channels 0) - `((channels . ,(number-to-string channels)))))) - ,@(mapcar - (lambda (param) - `(parameter - ((name . ,(nth 0 param)) - (value . ,(nth 1 param))))) - (nth 5 codec)))) - (plist-get state-data :our-codecs))) + ,@payload-types) (transport ((xmlns . ,jingle-ice-udp-ns))))) (lambda (jc iq fsm) (fsm-send-sync fsm (cons :iq-result iq))) |