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
|
@ -52,21 +52,21 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type sender struct {
|
type sender struct {
|
||||||
buf [][]byte
|
buf [][]byte
|
||||||
tstDiscon bool
|
testDiscontinuities bool
|
||||||
disconAt int
|
discontinuityAt int
|
||||||
curPktNo int
|
currentPkt int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ts *sender) send(d []byte) error {
|
func (ts *sender) send(d []byte) error {
|
||||||
if ts.tstDiscon && ts.curPktNo == ts.disconAt {
|
if ts.testDiscontinuities && ts.currentPkt == ts.discontinuityAt {
|
||||||
ts.curPktNo++
|
ts.currentPkt++
|
||||||
return errors.New("could not send")
|
return errors.New("could not send")
|
||||||
}
|
}
|
||||||
cpy := make([]byte, len(d))
|
cpy := make([]byte, len(d))
|
||||||
copy(cpy, d)
|
copy(cpy, d)
|
||||||
ts.buf = append(ts.buf, cpy)
|
ts.buf = append(ts.buf, cpy)
|
||||||
ts.curPktNo++
|
ts.currentPkt++
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ func TestSendFailDiscontinuity(t *testing.T) {
|
||||||
// Create ringbuffer tst sender, loadsender and the mpegts encoder
|
// Create ringbuffer tst sender, loadsender and the mpegts encoder
|
||||||
rb := ring.NewBuffer(rbSize, rbElementSize, wTimeout)
|
rb := ring.NewBuffer(rbSize, rbElementSize, wTimeout)
|
||||||
const disconClipNo = 3
|
const disconClipNo = 3
|
||||||
tstSender := &sender{tstDiscon: true, disconAt: disconClipNo}
|
tstSender := &sender{testDiscontinuities: true, discontinuityAt: disconClipNo}
|
||||||
loadSender := newMtsSender(tstSender, log)
|
loadSender := newMtsSender(tstSender, log)
|
||||||
packer := tstPacker{rb: rb}
|
packer := tstPacker{rb: rb}
|
||||||
encoder := mts.NewEncoder(&packer, 25)
|
encoder := mts.NewEncoder(&packer, 25)
|
||||||
|
|
Loading…
Reference in New Issue