Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
7590588a
Commit
7590588a
authored
May 14, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't renegotiate if nothing changed during a request.
parent
16bf4d6c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
rtpconn/webclient.go
rtpconn/webclient.go
+16
-9
No files found.
rtpconn/webclient.go
View file @
7590588a
...
...
@@ -426,7 +426,7 @@ func delDownTrackUnlocked(conn *rtpDownConnection, track *rtpDownTrack) error {
return
os
.
ErrNotExist
}
func
replaceTracks
(
conn
*
rtpDownConnection
,
remote
[]
conn
.
UpTrack
,
remoteConn
conn
.
Up
)
error
{
func
replaceTracks
(
conn
*
rtpDownConnection
,
remote
[]
conn
.
UpTrack
,
remoteConn
conn
.
Up
)
(
bool
,
error
)
{
conn
.
mu
.
Lock
()
defer
conn
.
mu
.
Unlock
()
...
...
@@ -437,12 +437,12 @@ outer:
for
_
,
rtrack
:=
range
remote
{
rt
,
ok
:=
rtrack
.
(
*
rtpUpTrack
)
if
!
ok
{
return
errUnexpectedTrackType
return
false
,
errUnexpectedTrackType
}
for
_
,
track
:=
range
conn
.
tracks
{
rt2
,
ok
:=
track
.
remote
.
(
*
rtpUpTrack
)
if
!
ok
{
return
errUnexpectedTrackType
return
false
,
errUnexpectedTrackType
}
if
rt
==
rt2
{
continue
outer
...
...
@@ -455,12 +455,12 @@ outer2:
for
_
,
track
:=
range
conn
.
tracks
{
rt
,
ok
:=
track
.
remote
.
(
*
rtpUpTrack
)
if
!
ok
{
return
errUnexpectedTrackType
return
false
,
errUnexpectedTrackType
}
for
_
,
rtrack
:=
range
remote
{
rt2
,
ok
:=
rtrack
.
(
*
rtpUpTrack
)
if
!
ok
{
return
errUnexpectedTrackType
return
false
,
errUnexpectedTrackType
}
if
rt
==
rt2
{
continue
outer2
...
...
@@ -469,21 +469,25 @@ outer2:
del
=
append
(
del
,
track
)
}
if
len
(
del
)
==
0
&&
len
(
add
)
==
0
{
return
false
,
nil
}
for
_
,
t
:=
range
del
{
err
:=
delDownTrackUnlocked
(
conn
,
t
)
if
err
!=
nil
{
return
err
return
false
,
err
}
}
for
_
,
rt
:=
range
add
{
err
:=
addDownTrackUnlocked
(
conn
,
rt
,
remoteConn
)
if
err
!=
nil
{
return
err
return
false
,
err
}
}
return
nil
return
true
,
nil
}
func
negotiate
(
c
*
webClient
,
down
*
rtpDownConnection
,
restartIce
bool
,
replace
string
)
error
{
...
...
@@ -906,10 +910,13 @@ func handleAction(c *webClient, a interface{}) error {
if
err
!=
nil
{
return
err
}
err
=
replaceTracks
(
down
,
tracks
,
a
.
conn
)
done
,
err
:
=
replaceTracks
(
down
,
tracks
,
a
.
conn
)
if
err
!=
nil
{
return
err
}
if
!
done
{
return
nil
}
if
a
.
replace
!=
""
{
err
:=
delDownConn
(
c
,
a
.
replace
)
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment