mirror of https://bitbucket.org/ausocean/av.git
rtp: removed code in rtpSender relating to chunks - something we're not using anymore in this case
This commit is contained in:
parent
4da0bddf2f
commit
5f20086440
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue