rtp: removed code in rtpSender relating to chunks - something we're not using anymore in this case

This commit is contained in:
saxon 2019-01-03 12:57:50 +10:30
parent 4da0bddf2f
commit 5f20086440
1 changed files with 2 additions and 18 deletions

View File

@ -368,7 +368,6 @@ func (s *udpSender) close() error { return nil }
// rtpSender implements loadSender for a native udp destination with rtp packetization.
type rtpSender struct {
log func(lvl int8, msg string, args ...interface{})
chunk *ring.Chunk
encoder *rtp.Encoder
}
@ -384,27 +383,12 @@ func newRtpSender(addr string, log func(lvl int8, msg string, args ...interface{
return s, nil
}
func (s *rtpSender) load(c *ring.Chunk) error {
s.chunk = c
return nil
}
func (s *rtpSender) send(d []byte) error {
var err error
switch {
case d != nil:
if d != nil {
_, err = s.encoder.Write(d)
case s.chunk != nil:
_, err = s.chunk.WriteTo(s.encoder)
default:
} else {
err = errors.New("no data to send provided, but rtpSender chunk is also empty")
}
return err
}
func (s *rtpSender) release() {
s.chunk.Close()
s.chunk = nil
}
func (s *rtpSender) close() error { return nil }