mirror of https://bitbucket.org/ausocean/av.git
revid: if no data is provided to rtpSender.send() then we check if the rtpSenders chunk is not nil, if it is, then return error
This commit is contained in:
parent
ccd4c32ff6
commit
d0d9e20c87
|
@ -29,6 +29,7 @@ LICENSE
|
|||
package revid
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
|
@ -392,13 +393,12 @@ func (s *rtpSender) send(d []byte) error {
|
|||
var err error
|
||||
if d != nil {
|
||||
_, err = s.encoder.Write(d)
|
||||
} else {
|
||||
} else if s.chunk != nil {
|
||||
_, err = s.chunk.WriteTo(s.encoder)
|
||||
} else {
|
||||
err = errors.New("no data provided, but rtpSender chunk is empty")
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *rtpSender) release() {
|
||||
|
|
Loading…
Reference in New Issue