diff --git a/revid/senders.go b/revid/senders.go index aa7144a6..662f4973 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -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 }