Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package galene for openSUSE:Factory checked 
in at 2022-03-25 21:54:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/galene (Old)
 and      /work/SRC/openSUSE:Factory/.galene.new.1900 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "galene"

Fri Mar 25 21:54:57 2022 rev:17 rq:964830 version:0.5.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/galene/galene.changes    2022-03-11 
11:42:19.646679025 +0100
+++ /work/SRC/openSUSE:Factory/.galene.new.1900/galene.changes  2022-03-25 
21:55:15.590311695 +0100
@@ -1,0 +2,12 @@
+Fri Mar 25 10:00:18 UTC 2022 - mich...@stroeder.com
+
+- Update to version 0.5.1:
+  * Enable simulcast on Firefox.
+  * Fix rate control on Firefox.
+  * Fix corruption after packet reordering when saving to disk.
+  * Fix the H.264 profile for compatibility with older iPhones.
+  * Display a warning when joining a locked group.
+  * Add a hook that allows the client to influence the ICE policy.
+  * Fix error handling in peer-to-peer file transfer.
+
+-------------------------------------------------------------------

Old:
----
  galene-0.5.tar.gz

New:
----
  galene-0.5.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ galene.spec ++++++
--- /var/tmp/diff_new_pack.ouFoRL/_old  2022-03-25 21:55:16.294312365 +0100
+++ /var/tmp/diff_new_pack.ouFoRL/_new  2022-03-25 21:55:16.298312368 +0100
@@ -25,7 +25,7 @@
 %bcond_without  apparmor
 
 Name:           galene
-Version:        0.5
+Version:        0.5.1
 Release:        0
 Summary:        Gal??ne videoconferencing server
 License:        MIT

++++++ _service ++++++
--- /var/tmp/diff_new_pack.ouFoRL/_old  2022-03-25 21:55:16.346312414 +0100
+++ /var/tmp/diff_new_pack.ouFoRL/_new  2022-03-25 21:55:16.350312418 +0100
@@ -1,10 +1,10 @@
 <services>
   <service name="tar_scm" mode="disabled">
-    <param name="url">git://github.com/jech/galene.git</param>
+    <param name="url">https://github.com/jech/galene.git</param>
     <param name="scm">git</param>
     <param name="exclude">.git</param>
-    <param name="revision">galene-0.5</param>
-    <param name="version">0.5</param>
+    <param name="revision">galene-0.5.1</param>
+    <param name="version">0.5.1</param>
     <param name="changesgenerate">enable</param>
     <!--param name="versionrewrite-pattern">galene-(\d+)</param>
     <param name="versionrewrite-replacement">\1</param-->

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.ouFoRL/_old  2022-03-25 21:55:16.378312445 +0100
+++ /var/tmp/diff_new_pack.ouFoRL/_new  2022-03-25 21:55:16.382312449 +0100
@@ -1,6 +1,8 @@
 <servicedata>
 <service name="tar_scm">
                 <param name="url">git://github.com/jech/galene.git</param>
-              <param 
name="changesrevision">ba75bfeb3acd33f92084fa0eb88be9aee824badf</param></service></servicedata>
+              <param 
name="changesrevision">ba75bfeb3acd33f92084fa0eb88be9aee824badf</param></service><service
 name="tar_scm">
+                <param name="url">https://github.com/jech/galene.git</param>
+              <param 
name="changesrevision">a7ccfba407dc6b5fa76c9110fff49858cdd476b1</param></service></servicedata>
 (No newline at EOF)
 

++++++ galene-0.5.tar.gz -> galene-0.5.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/galene-0.5/CHANGES new/galene-0.5.1/CHANGES
--- old/galene-0.5/CHANGES      2022-03-08 16:07:38.000000000 +0100
+++ new/galene-0.5.1/CHANGES    2022-03-25 10:44:45.000000000 +0100
@@ -1,3 +1,13 @@
+25 March 2022: Galene 0.5.1
+
+  * Enable simulcast on Firefox.
+  * Fix rate control on Firefox.
+  * Fix corruption after packet reordering when saving to disk.
+  * Fix the H.264 profile for compatibility with older iPhones.
+  * Display a warning when joining a locked group.
+  * Add a hook that allows the client to influence the ICE policy.
+  * Fix error handling in peer-to-peer file transfer.
+
 8 March 2022: Galene 0.5
 
   * Implement third-party (token-based) authentication.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/galene-0.5/diskwriter/diskwriter.go 
new/galene-0.5.1/diskwriter/diskwriter.go
--- old/galene-0.5/diskwriter/diskwriter.go     2022-03-08 16:07:38.000000000 
+0100
+++ new/galene-0.5.1/diskwriter/diskwriter.go   2022-03-25 10:44:45.000000000 
+0100
@@ -337,21 +337,21 @@
                codec := remote.Codec()
                if strings.EqualFold(codec.MimeType, "audio/opus") {
                        builder = samplebuilder.New(
-                               32, &codecs.OpusPacket{}, codec.ClockRate,
+                               16, &codecs.OpusPacket{}, codec.ClockRate,
                        )
                } else if strings.EqualFold(codec.MimeType, "video/vp8") {
                        builder = samplebuilder.New(
-                               1024, &codecs.VP8Packet{}, codec.ClockRate,
+                               256, &codecs.VP8Packet{}, codec.ClockRate,
                        )
                        conn.hasVideo = true
                } else if strings.EqualFold(codec.MimeType, "video/vp9") {
                        builder = samplebuilder.New(
-                               1024, &codecs.VP9Packet{}, codec.ClockRate,
+                               256, &codecs.VP9Packet{}, codec.ClockRate,
                        )
                        conn.hasVideo = true
                } else if strings.EqualFold(codec.MimeType, "video/h264") {
                        builder = samplebuilder.New(
-                               1024, &codecs.H264Packet{}, codec.ClockRate,
+                               256, &codecs.H264Packet{}, codec.ClockRate,
                        )
                        conn.hasVideo = true
                } else {
@@ -634,11 +634,22 @@
                return err
        }
 
+       interceptor, err := mkvcore.NewMultiTrackBlockSorter(
+               // must be larger than the samplebuilder's MaxLate.
+               mkvcore.WithMaxDelayedPackets(384),
+               mkvcore.WithSortRule(mkvcore.BlockSorterDropOutdated),
+       )
+       if err != nil {
+               conn.file.Close()
+               conn.file = nil
+               return err
+       }
+
        ws, err := mkvcore.NewSimpleBlockWriter(
                conn.file, desc,
                mkvcore.WithEBMLHeader(header),
                mkvcore.WithSegmentInfo(webm.DefaultSegmentInfo),
-               mkvcore.WithBlockInterceptor(webm.DefaultBlockInterceptor),
+               mkvcore.WithBlockInterceptor(interceptor),
        )
        if err != nil {
                conn.file.Close()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/galene-0.5/go.mod new/galene-0.5.1/go.mod
--- old/galene-0.5/go.mod       2022-03-08 16:07:38.000000000 +0100
+++ new/galene-0.5.1/go.mod     2022-03-25 10:44:45.000000000 +0100
@@ -8,12 +8,12 @@
        github.com/gorilla/websocket v1.5.0
        github.com/jech/cert v0.0.0-20210819231831-aca735647728
        github.com/jech/samplebuilder v0.0.0-20220125212352-4553ed6f9a6c
-       github.com/pion/ice/v2 v2.1.20
+       github.com/pion/ice/v2 v2.2.2
        github.com/pion/rtcp v1.2.9
-       github.com/pion/rtp v1.7.4
+       github.com/pion/rtp v1.7.7
        github.com/pion/sdp/v3 v3.0.4
        github.com/pion/turn/v2 v2.0.8
-       github.com/pion/webrtc/v3 v3.1.23
+       github.com/pion/webrtc/v3 v3.1.25
        golang.org/x/crypto v0.0.0-20220214200702-86341886e292
        golang.org/x/sys v0.0.0-20220209214540-3681064d5158
 )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/galene-0.5/go.sum new/galene-0.5.1/go.sum
--- old/galene-0.5/go.sum       2022-03-08 16:07:38.000000000 +0100
+++ new/galene-0.5.1/go.sum     2022-03-25 10:44:45.000000000 +0100
@@ -51,15 +51,14 @@
 github.com/pion/datachannel v1.5.2 
h1:piB93s8LGmbECrpO84DnkIVWasRMk3IimbcXkTQLE6E=
 github.com/pion/datachannel v1.5.2/go.mod 
h1:FTGQWaHrdCwIJ1rw6xBIfZVkslikjShim5yr05XFuCQ=
 github.com/pion/dtls/v2 v2.0.9/go.mod 
h1:O0Wr7si/Zj5/EBFlDzDd6UtVxx25CE1r7XM7BQKYQho=
-github.com/pion/dtls/v2 v2.1.1/go.mod 
h1:qG3gA7ZPZemBqpEFqRKyURYdKEwFZQCGb7gv9T3ON3Y=
-github.com/pion/dtls/v2 v2.1.2 h1:22Q1Jk9L++Yo7BIf9130MonNPfPVb+YgdYLeyQotuAA=
-github.com/pion/dtls/v2 v2.1.2/go.mod 
h1:o6+WvyLDAlXF7YiPB/RlskRoeK+/JtuaZa5emwQcWus=
+github.com/pion/dtls/v2 v2.1.3 h1:3UF7udADqous+M2R5Uo2q/YaP4EzUoWKdfX2oscCUio=
+github.com/pion/dtls/v2 v2.1.3/go.mod 
h1:o6+WvyLDAlXF7YiPB/RlskRoeK+/JtuaZa5emwQcWus=
 github.com/pion/ice/v2 v2.1.12/go.mod 
h1:ovgYHUmwYLlRvcCLI67PnQ5YGe+upXZbGgllBDG/ktU=
-github.com/pion/ice/v2 v2.1.20 h1:xpxXyX5b4WjCh/D905gzBeW/hbJxMEPx2ptVfrhVE6M=
-github.com/pion/ice/v2 v2.1.20/go.mod 
h1:hEAldRzBhTtAfvlU1V/2/nLCMvveQWFKPNCop+63/Iw=
+github.com/pion/ice/v2 v2.2.2 h1:UfmAslxZ0u0itVjA4x7aw7WeQIv22FdF8VjW9cM+74g=
+github.com/pion/ice/v2 v2.2.2/go.mod 
h1:vLI7dFqxw8zMSb9J+ca74XU7JjLhddgfQB9+BbTydCo=
 github.com/pion/interceptor v0.1.0/go.mod 
h1:j5NIl3tJJPB3u8+Z2Xz8MZs/VV6rc+If9mXEKNuFmEM=
-github.com/pion/interceptor v0.1.7 
h1:HThW0tIIKT9RRoDWGURe8rlZVOx0fJHxBHpA0ej0+bo=
-github.com/pion/interceptor v0.1.7/go.mod 
h1:Lh3JSl/cbJ2wP8I3ccrjh1K/deRGRn3UlSPuOTiHb6U=
+github.com/pion/interceptor v0.1.10 
h1:DJ2GjMGm4XGIQgMJxuEpdaExdY/6RdngT7Uh4oVmquU=
+github.com/pion/interceptor v0.1.10/go.mod 
h1:Lh3JSl/cbJ2wP8I3ccrjh1K/deRGRn3UlSPuOTiHb6U=
 github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
 github.com/pion/logging v0.2.2/go.mod 
h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
 github.com/pion/mdns v0.0.5 h1:Q2oj/JB3NqfzY9xGZ1fPzZzK7sDSD8rZPOvcIQ10BCw=
@@ -72,8 +71,9 @@
 github.com/pion/rtcp v1.2.9/go.mod 
h1:qVPhiCzAm4D/rxb6XzKeyZiQK69yJpbUDJSF7TgrqNo=
 github.com/pion/rtp v1.7.0/go.mod 
h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
 github.com/pion/rtp v1.7.2/go.mod 
h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
-github.com/pion/rtp v1.7.4 h1:4dMbjb1SuynU5OpA3kz1zHK+u+eOCQjW3MAeVHf1ODA=
 github.com/pion/rtp v1.7.4/go.mod 
h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
+github.com/pion/rtp v1.7.7 h1:MzaAfCVicTVxiZpM2o99+YFrKxyRsQ38nnIi4vJPuUY=
+github.com/pion/rtp v1.7.7/go.mod 
h1:bDb5n+BFZxXx0Ea7E5qe+klMuqiBrP+w8XSjiWtCUko=
 github.com/pion/sctp v1.7.10/go.mod 
h1:EhpTUQu1/lcK3xI+eriS6/96fWetHGCvBi9MSsnaBN0=
 github.com/pion/sctp v1.7.12/go.mod 
h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s=
 github.com/pion/sctp v1.8.0/go.mod 
h1:xFe9cLMZ5Vj6eOzpyiKjT9SwGM4KpK/8Jbw5//jc+0s=
@@ -91,14 +91,13 @@
 github.com/pion/transport v0.13.0 
h1:KWTA5ZrQogizzYwPEciGtHPLwpAjE91FgXnyu+Hv2uY=
 github.com/pion/transport v0.13.0/go.mod 
h1:yxm9uXpK9bpBBWkITk13cLo1y5/ur5VQpG22ny6EP7g=
 github.com/pion/turn/v2 v2.0.5/go.mod 
h1:APg43CFyt/14Uy7heYUOGWdkem/Wu4PhCO/bjyrTqMw=
-github.com/pion/turn/v2 v2.0.6/go.mod 
h1:+y7xl719J8bAEVpSXBXvTxStjJv3hbz9YFflvkpcGPw=
 github.com/pion/turn/v2 v2.0.8 h1:KEstL92OUN3k5k8qxsXHpr7WWfrdp7iJZHx99ud8muw=
 github.com/pion/turn/v2 v2.0.8/go.mod 
h1:+y7xl719J8bAEVpSXBXvTxStjJv3hbz9YFflvkpcGPw=
 github.com/pion/udp v0.1.1 h1:8UAPvyqmsxK8oOjloDk4wUt63TzFe9WEJkg5lChlj7o=
 github.com/pion/udp v0.1.1/go.mod 
h1:6AFo+CMdKQm7UiA0eUPA8/eVCTx8jBIITLZHc9DWX5M=
 github.com/pion/webrtc/v3 v3.1.0/go.mod 
h1:t51XSam1k56eYLuO1Ubxjs3pDBfGYxkGBFhYf55Mn/s=
-github.com/pion/webrtc/v3 v3.1.23 
h1:suyNiF9o2/6SBsyWA1UweraUWYkaHCNJdt/16b61I5w=
-github.com/pion/webrtc/v3 v3.1.23/go.mod 
h1:L5S/oAhL0Fzt/rnftVQRrP80/j5jygY7XRZzWwFx6P4=
+github.com/pion/webrtc/v3 v3.1.25 
h1:8bTa2lLI5rszkKCKVO6L9VlKhhmmwMXZ/beSWLwQK14=
+github.com/pion/webrtc/v3 v3.1.25/go.mod 
h1:BA9hvF1mCu64w/to7nHrSNMxx+zMqVst990zA7xgfCM=
 github.com/pkg/errors v0.9.1/go.mod 
h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
 github.com/pmezard/go-difflib v1.0.0 
h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
 github.com/pmezard/go-difflib v1.0.0/go.mod 
h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
@@ -113,7 +112,6 @@
 golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod 
h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
 golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod 
h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
 golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod 
h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
-golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod 
h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod 
h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
 golang.org/x/crypto v0.0.0-20220214200702-86341886e292 
h1:f+lwQ+GtmgoY+A2YaQxlSOnDjXcQ7ZRLWOHbC6HtRqE=
 golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod 
h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
@@ -134,9 +132,9 @@
 golang.org/x/net v0.0.0-20210825183410-e898025ed96a/go.mod 
h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod 
h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
 golang.org/x/net v0.0.0-20211201190559-0a0e4e1bb54c/go.mod 
h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod 
h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
-golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd 
h1:O7DYs+zxREGLKzKoMQrtrEacpb0ZVXA5rIwylE2Xchk=
 golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod 
h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
+golang.org/x/net v0.0.0-20220225172249-27dd8689420f 
h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
+golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod 
h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
 golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod 
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod 
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
 golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod 
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/galene-0.5/group/group.go 
new/galene-0.5.1/group/group.go
--- old/galene-0.5/group/group.go       2022-03-08 16:07:38.000000000 +0100
+++ new/galene-0.5.1/group/group.go     2022-03-25 10:44:45.000000000 +0100
@@ -271,11 +271,6 @@
                codecs = []webrtc.RTPCodecCapability{
                        {
                                "video/H264", 90000, 0,
-                               
"level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f",
-                               fb,
-                       },
-                       {
-                               "video/H264", 90000, 0,
                                
"level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f",
                                fb,
                        },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/galene-0.5/static/galene.js 
new/galene-0.5.1/static/galene.js
--- old/galene-0.5/static/galene.js     2022-03-08 16:07:38.000000000 +0100
+++ new/galene-0.5.1/static/galene.js   2022-03-25 10:44:45.000000000 +0100
@@ -47,6 +47,7 @@
  * @property {string} [filter]
  * @property {boolean} [preprocessing]
  * @property {boolean} [hqaudio]
+ * @property {boolean} [forceRelay]
  */
 
 /** @type{settings} */
@@ -326,6 +327,21 @@
 
 /**
  * @this {ServerConnection}
+ */
+function onPeerConnection() {
+    if(!getSettings().forceRelay)
+        return null;
+    let old = this.rtcConfiguration;
+    /** @type {RTCConfiguration} */
+    let conf = {};
+    for(let key in old)
+        conf[key] = old[key];
+    conf.iceTransportPolicy = 'relay';
+    return conf;
+}
+
+/**
+ * @this {ServerConnection}
  * @param {number} code
  * @param {string} reason
  */
@@ -855,11 +871,9 @@
         if(!s.track || s.track.kind !== 'video')
             continue;
         let p = s.getParameters();
-        if(!p.encodings)
-            p.encodings = [{}];
-        if((!simulcast && p.encodings.length != 1) ||
+        if((!p.encodings ||
+            !simulcast && p.encodings.length != 1) ||
            (simulcast && p.encodings.length != 2)) {
-            // change the simulcast envelope
             await replaceUpStream(c);
             return;
         }
@@ -1191,16 +1205,23 @@
         let simulcast = doSimulcast();
         if(t.kind === 'video') {
             let bps = getMaxVideoThroughput();
-            encodings.push({
-                rid: 'h',
-                maxBitrate: bps || unlimitedRate,
-            });
-            if(simulcast)
+            // Firefox doesn't like us setting the RID if we're not
+            // simulcasting.
+            if(simulcast) {
+                encodings.push({
+                    rid: 'h',
+                    maxBitrate: bps || unlimitedRate,
+                });
                 encodings.push({
                     rid: 'l',
                     scaleResolutionDownBy: 2,
                     maxBitrate: simulcastRate,
                 });
+            } else {
+                encodings.push({
+                    maxBitrate: bps || unlimitedRate,
+                });
+            }
         } else {
             if(c.label !== 'camera' || settings.hqaudio) {
                 encodings.push({
@@ -1213,15 +1234,24 @@
             streams: [stream],
             sendEncodings: encodings,
         });
-        if(t.kind === 'video') {
-            let p = tr.sender.getParameters();
-            if(!p.encodings) {
-                // Firefox workaround
-                updateSettings({simulcast: 'off'});
-                reflectSettings();
-                p.encodings = [encodings[0]];
-                tr.sender.setParameters(p);
+
+        // Firefox workaround
+        function match(a, b) {
+            if(!a || !b)
+                return false;
+            if(a.length !== b.length)
+                return false;
+            for(let i = 0; i < a.length; i++) {
+                if(a.maxBitrate !== b.maxBitrate)
+                    return false;
             }
+            return true;
+        }
+
+        let p = tr.sender.getParameters();
+        if(!p || !match(p.encodings, encodings)) {
+            p.encodings = encodings;
+            tr.sender.setParameters(p);
         }
     }
 
@@ -2255,6 +2285,9 @@
     input.placeholder = 'Type /help for help';
     setTimeout(() => {input.placeholder = '';}, 8000);
 
+    if(status.locked)
+        displayWarning('This group is locked');
+
     if(typeof RTCPeerConnection === 'undefined')
         displayWarning("This browser doesn't support WebRTC");
     else
@@ -2336,6 +2369,11 @@
 };
 
 TransferredFile.prototype.close = function() {
+    if(this.dc) {
+        this.dc.onclose = null;
+        this.dc.onerror = null;
+        this.dc.onmessage = null;
+    }
     if(this.pc)
         this.pc.close();
     this.dc = null;
@@ -2455,6 +2493,8 @@
  * @param {any} message
  */
 function failFile(f, message) {
+    if(!f.dc)
+        return;
     console.error('File transfer failed:', message);
     setFileStatus(f, message ? `Failed: ${message}` : 'Failed.');
     f.close();
@@ -2504,7 +2544,7 @@
     if(f.pc)
         throw new Error("Download already in progress");
     setFileStatus(f, 'Connecting...', true);
-    let pc = new RTCPeerConnection(serverConnection.rtcConfiguration);
+    let pc = new RTCPeerConnection(serverConnection.getRTCConfiguration());
     if(!pc)
         throw new Error("Couldn't create peer connection");
     f.pc = pc;
@@ -2574,7 +2614,7 @@
         throw new Error('Transfer already in progress');
 
     setFileStatus(f, 'Negotiating...', true);
-    let pc = new RTCPeerConnection(serverConnection.rtcConfiguration);
+    let pc = new RTCPeerConnection(serverConnection.getRTCConfiguration());
     if(!pc)
         throw new Error("Couldn't create peer connection");
     f.pc = pc;
@@ -2656,12 +2696,14 @@
     async function write(a) {
         while(f.dc.bufferedAmount > f.dc.bufferedAmountLowThreshold) {
             await new Promise((resolve, reject) => {
-                if(f.dc == null) {
+                if(!f.dc) {
                     reject(new Error('File is closed.'));
+                    return;
                 }
                 f.dc.onbufferedamountlow = function(e) {
-                    if(f.dc == null) {
+                    if(!f.dc) {
                         reject(new Error('File is closed.'));
+                        return;
                     }
                     f.dc.onbufferedamountlow = null;
                     resolve();
@@ -2772,7 +2814,7 @@
  * @param {TransferredFile} f
  */
 function closeReceiveFileData(f) {
-    if(f.datalen != f.size) {
+    if(f.datalen !== f.size) {
         setFileStatus(f, 'Failed.', true, true)
         f.close();
     }
@@ -3494,7 +3536,7 @@
 async function relayTest() {
     if(!serverConnection)
         throw new Error('not connected');
-    let conf = Object.assign({}, serverConnection.rtcConfiguration);
+    let conf = Object.assign({}, serverConnection.getRTCConfiguration());
     conf.iceTransportPolicy = 'relay';
     let pc1 = new RTCPeerConnection(conf);
     let pc2 = new RTCPeerConnection(conf);
@@ -3810,6 +3852,7 @@
         serverConnection.close();
     serverConnection = new ServerConnection();
     serverConnection.onconnected = gotConnected;
+    serverConnection.onpeerconnection = onPeerConnection;
     serverConnection.onclose = gotClose;
     serverConnection.ondownstream = gotDownStream;
     serverConnection.onuser = gotUser;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/galene-0.5/static/protocol.js 
new/galene-0.5.1/static/protocol.js
--- old/galene-0.5/static/protocol.js   2022-03-08 16:07:38.000000000 +0100
+++ new/galene-0.5.1/static/protocol.js 2022-03-25 10:44:45.000000000 +0100
@@ -22,6 +22,7 @@
 
 /**
  * toHex formats an array as a hexadecimal string.
+ *
  * @param {number[]|Uint8Array} array - the array to format
  * @returns {string} - the hexadecimal representation of array
  */
@@ -152,6 +153,14 @@
      */
     this.onclose = null;
     /**
+     * onpeerconnection is called before we establish a new peer connection.
+     * It may either return null, or a new RTCConfiguration that overrides
+     * the value obtained from the server.
+     *
+     * @type{(this: ServerConnection) => RTCConfiguration}
+     */
+    this.onpeerconnection = null;
+    /**
      * onuser is called whenever a user in the group changes.  The users
      * array has already been updated.
      *
@@ -495,6 +504,9 @@
 };
 
 /**
+ * findByLocalId finds an active connection with the given localId.
+ * It returns null if none was find.
+ *
  * @param {string} localId
  * @returns {Stream}
  */
@@ -513,6 +525,22 @@
 }
 
 /**
+ * getRTCConfiguration returns the RTCConfiguration that should be used
+ * with this peer connection.  This usually comes from the server, but may
+ * be overridden by the onpeerconnection callback.
+ *
+ * @returns {RTCConfiguration}
+ */
+ServerConnection.prototype.getRTCConfiguration = function() {
+    if(this.onpeerconnection) {
+        let conf = this.onpeerconnection.call(this);
+        if(conf !== null)
+            return conf;
+    }
+    return this.rtcConfiguration;
+}
+
+/**
  * newUpStream requests the creation of a new up stream.
  *
  * @param {string} [localId]
@@ -529,7 +557,8 @@
     if(typeof RTCPeerConnection === 'undefined')
         throw new Error("This browser doesn't support WebRTC");
 
-    let pc = new RTCPeerConnection(sc.rtcConfiguration);
+
+    let pc = new RTCPeerConnection(sc.getRTCConfiguration());
     if(!pc)
         throw new Error("Couldn't create peer connection");
 
@@ -645,7 +674,7 @@
 };
 
 /**
- * Called when we receive an offer from the server.  Don't call this.
+ * gotOffer is called when we receive an offer from the server.  Don't call 
this.
  *
  * @param {string} id
  * @param {string} label
@@ -685,7 +714,7 @@
     if(!c) {
         let pc;
         try {
-            pc = new RTCPeerConnection(sc.rtcConfiguration);
+            pc = new RTCPeerConnection(sc.getRTCConfiguration());
         } catch(e) {
             console.error(e);
             sc.send({
@@ -772,7 +801,8 @@
 };
 
 /**
- * Called when we receive an answer from the server.  Don't call this.
+ * gotAnswer is called when we receive an answer from the server.  Don't
+ * call this.
  *
  * @param {string} id
  * @param {string} sdp
@@ -802,8 +832,8 @@
 };
 
 /**
- * Called when we receive a renegotiation request from the server.  Don't
- * call this.
+ * gotRenegotiate is called when we receive a renegotiation request from
+ * the server.  Don't call this.
  *
  * @param {string} id
  * @function
@@ -816,7 +846,8 @@
 };
 
 /**
- * Called when we receive a close request from the server.  Don't call this.
+ * gotClose is called when we receive a close request from the server.
+ * Don't call this.
  *
  * @param {string} id
  */
@@ -830,7 +861,8 @@
 };
 
 /**
- * Called when we receive an abort message from the server.  Don't call this.
+ * gotAbort is called when we receive an abort message from the server.
+ * Don't call this.
  *
  * @param {string} id
  */
@@ -842,7 +874,8 @@
 };
 
 /**
- * Called when we receive an ICE candidate from the server.  Don't call this.
+ * gotRemoteIce is called when we receive an ICE candidate from the server.
+ * Don't call this.
  *
  * @param {string} id
  * @param {RTCIceCandidate} candidate
@@ -1082,6 +1115,9 @@
 };
 
 /**
+ * recomputeUserStreams recomputes the user.down array for a given user.
+ * It returns true if anything changed.
+ *
  * @param {ServerConnection} sc
  * @param {string} id
  * @param {Stream} [c]
@@ -1142,7 +1178,7 @@
 };
 
 /**
- * Called when we get a local ICE candidate.  Don't call this.
+ * gotLocalIce is Called when we get a local ICE candidate.  Don't call this.
  *
  * @param {RTCIceCandidate} candidate
  * @function
@@ -1161,6 +1197,7 @@
 /**
  * flushLocalIceCandidates flushes any buffered local ICE candidates.
  * It is called when we send an offer.
+ *
  * @function
  */
 Stream.prototype.flushLocalIceCandidates = function () {
@@ -1183,6 +1220,7 @@
 /**
  * flushRemoteIceCandidates flushes any buffered remote ICE candidates.  It is
  * called automatically when we get a remote description.
+ *
  * @function
  */
 Stream.prototype.flushRemoteIceCandidates = async function () {
@@ -1310,8 +1348,9 @@
             for(let r of report.values()) {
                 if(stid && r.type === 'outbound-rtp') {
                     let id = stid;
-                    if(r.rid)
-                        id = id + '-' + r.rid
+                    // Firefox doesn't implement rid, use ssrc
+                    // to discriminate simulcast tracks.
+                    id = id + '-' + r.ssrc;
                     if(!('bytesSent' in r))
                         continue;
                     if(!stats[id])

++++++ vendor.tar.gz ++++++
++++ 2485 lines of diff (skipped)

Reply via email to