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:
saxon 2019-01-01 16:11:32 +10:30
parent ccd4c32ff6
commit d0d9e20c87
1 changed files with 5 additions and 5 deletions

View File

@ -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
}
func (s *rtpSender) release() {