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
Alain Takoudjou
galene
Commits
d9e72f4f
Commit
d9e72f4f
authored
Feb 02, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return an error when adding a duplicate down track.
parent
73f72c45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
rtpconn/webclient.go
rtpconn/webclient.go
+14
-2
No files found.
rtpconn/webclient.go
View file @
d9e72f4f
...
...
@@ -403,6 +403,20 @@ func addDownTrack(c *webClient, conn *rtpDownConnection, remoteTrack conn.UpTrac
return
nil
,
errors
.
New
(
"unexpected up track type"
)
}
conn
.
mu
.
Lock
()
defer
conn
.
mu
.
Unlock
()
remoteSSRC
:=
rt
.
track
.
SSRC
()
for
_
,
t
:=
range
conn
.
tracks
{
tt
,
ok
:=
t
.
remote
.
(
*
rtpUpTrack
)
if
!
ok
{
return
nil
,
errors
.
New
(
"unexpected up track type"
)
}
if
tt
.
track
.
SSRC
()
==
remoteSSRC
{
return
nil
,
os
.
ErrExist
}
}
local
,
err
:=
webrtc
.
NewTrackLocalStaticRTP
(
remoteTrack
.
Codec
(),
rt
.
track
.
ID
(),
rt
.
track
.
StreamID
(),
...
...
@@ -431,9 +445,7 @@ func addDownTrack(c *webClient, conn *rtpDownConnection, remoteTrack conn.UpTrac
atomics
:
&
downTrackAtomics
{},
}
conn
.
mu
.
Lock
()
conn
.
tracks
=
append
(
conn
.
tracks
,
track
)
conn
.
mu
.
Unlock
()
go
rtcpDownListener
(
conn
,
track
,
sender
)
...
...
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