Skip to content

Pushing to RTCTrack can cause panics/drops #405

@kixelated

Description

@kixelated

The current interface uses the channels RTCTrack.Samples chan<- media.RTCSample and RTCTrack.RawRTP chan<- *rtp.Packet to send data over the connection.

If the connection is closed, these channels are closed. Sending to a closed channel will cause the code to panic. I've also seen a lot of packet drops because the buffered channel (size 15) is not large enough to handle surges.

I would love to change the API such that you call WriteSample or WritePacket instead of interfacing with channels. I also don't think this should be part of the RTPTrack, but instead the RTCRtpSender returned by AddTrack.

This should also be a blocking call which would remove a goroutine and some context switching. It would go a long way for my project which creates thousands of peer connections.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions