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