mirror of https://bitbucket.org/ausocean/av.git
revid: renamed fields of sender in mtsSender_test.go
This commit is contained in:
parent
b3f2439c5b
commit
8baff93918
|
@ -53,20 +53,20 @@ const (
|
|||
|
||||
type sender struct {
|
||||
buf [][]byte
|
||||
tstDiscon bool
|
||||
disconAt int
|
||||
curPktNo int
|
||||
testDiscontinuities bool
|
||||
discontinuityAt int
|
||||
currentPkt int
|
||||
}
|
||||
|
||||
func (ts *sender) send(d []byte) error {
|
||||
if ts.tstDiscon && ts.curPktNo == ts.disconAt {
|
||||
ts.curPktNo++
|
||||
if ts.testDiscontinuities && ts.currentPkt == ts.discontinuityAt {
|
||||
ts.currentPkt++
|
||||
return errors.New("could not send")
|
||||
}
|
||||
cpy := make([]byte, len(d))
|
||||
copy(cpy, d)
|
||||
ts.buf = append(ts.buf, cpy)
|
||||
ts.curPktNo++
|
||||
ts.currentPkt++
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ func TestSendFailDiscontinuity(t *testing.T) {
|
|||
// Create ringbuffer tst sender, loadsender and the mpegts encoder
|
||||
rb := ring.NewBuffer(rbSize, rbElementSize, wTimeout)
|
||||
const disconClipNo = 3
|
||||
tstSender := &sender{tstDiscon: true, disconAt: disconClipNo}
|
||||
tstSender := &sender{testDiscontinuities: true, discontinuityAt: disconClipNo}
|
||||
loadSender := newMtsSender(tstSender, log)
|
||||
packer := tstPacker{rb: rb}
|
||||
encoder := mts.NewEncoder(&packer, 25)
|
||||
|
|
Loading…
Reference in New Issue