diff --git a/revid/mtsSender_test.go b/revid/mtsSender_test.go index 81270191..f600a664 100644 --- a/revid/mtsSender_test.go +++ b/revid/mtsSender_test.go @@ -114,6 +114,7 @@ func (p *tstPacker) Write(d []byte) (int, error) { // based on positioning of PSI in the mtsEncoder's output stream. func TestSegment(t *testing.T) { mts.Meta = meta.New() + // Create ringBuffer, sender, loadsender and the MPEGTS encoder. rb := ring.NewBuffer(rbSize, rbElementSize, wTimeout) tstSender := &sender{} @@ -155,6 +156,7 @@ func TestSegment(t *testing.T) { expectData := 0 for clipNo, clip := range result { t.Logf("Checking clip: %v\n", clipNo) + // Check that the clip is of expected length. clipLen := len(clip) if clipLen != psiSendCount*mts.PacketSize { @@ -202,6 +204,7 @@ func TestSegment(t *testing.T) { func TestSendFailDiscontinuity(t *testing.T) { mts.Meta = meta.New() + // Create ringBuffer sender, loadSender and the MPEGTS encoder. rb := ring.NewBuffer(rbSize, rbElementSize, wTimeout) const clipWithDiscontinuity = 3 @@ -244,6 +247,7 @@ func TestSendFailDiscontinuity(t *testing.T) { if gotLen != expectedLen { t.Errorf("We don't have one less clip as we should. Got: %v, want: %v\n", gotLen, expectedLen) } + // Now check that the discontinuity indicator is set at the discontinuityClip PAT. disconClip := result[clipWithDiscontinuity] firstPkt := disconClip[:mts.PacketSize]