diff --git a/revid/mtsSender_test.go b/revid/mtsSender_test.go index c96613cb..c4a4f1ab 100644 --- a/revid/mtsSender_test.go +++ b/revid/mtsSender_test.go @@ -51,14 +51,14 @@ const ( rTimeout = 10 * time.Millisecond ) -type testSender struct { +type sender struct { Buf [][]byte tstDiscon bool disconAt int curPktNo int } -func (ts *testSender) send(d []byte) error { +func (ts *sender) send(d []byte) error { if ts.tstDiscon && ts.curPktNo == ts.disconAt { ts.curPktNo++ return errors.New("could not send") @@ -105,7 +105,7 @@ func TestSegment(t *testing.T) { mts.Meta = meta.New() // Create ringbuffer tst sender, loadsender and the mpegts encoder rb := ring.NewBuffer(rbSize, rbElementSize, wTimeout) - tstSender := &testSender{} + tstSender := &sender{} loadSender := newMtsSender(tstSender, log) packer := &tstPacker{rb: rb} encoder := mts.NewEncoder(packer, 25) @@ -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 := &testSender{tstDiscon: true, disconAt: disconClipNo} + tstSender := &sender{tstDiscon: true, disconAt: disconClipNo} loadSender := newMtsSender(tstSender, log) packer := tstPacker{rb: rb} encoder := mts.NewEncoder(&packer, 25) diff --git a/revid/senders.go b/revid/senders.go index 03b4afc6..9c8619b3 100644 --- a/revid/senders.go +++ b/revid/senders.go @@ -45,7 +45,7 @@ import ( "github.com/Comcast/gots/packet" ) -type sender interface { +type Sender interface { send(d []byte) error } @@ -132,7 +132,7 @@ func (s *fileSender) close() error { // clips based on PSI. It also fixes accounts for discontinuities by setting // the discontinuity indicator for the first packet of a clip. type mtsSender struct { - sender sender + sender Sender buf []byte next []byte pkt [mts.PacketSize]byte @@ -144,7 +144,7 @@ type mtsSender struct { } // newmtsSender returns a new mtsSender. -func newMtsSender(s sender, log func(lvl int8, msg string, args ...interface{})) *mtsSender { +func newMtsSender(s Sender, log func(lvl int8, msg string, args ...interface{})) *mtsSender { return &mtsSender{ sender: s, repairer: mts.NewDiscontinuityRepairer(),