mirror of https://bitbucket.org/ausocean/av.git
revid: cleaned up code structure in mtsSender_test.go
This commit is contained in:
parent
ef5e43dac7
commit
8452d8f3d1
|
@ -116,11 +116,10 @@ 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{}
|
||||
loadSender := newMtsSender(tstSender, log)
|
||||
packer := &tstPacker{rb: rb}
|
||||
encoder := mts.NewEncoder(packer, 25)
|
||||
rb := ring.NewBuffer(rbSize, rbElementSize, wTimeout)
|
||||
encoder := mts.NewEncoder(&tstPacker{rb: rb}, 25)
|
||||
|
||||
// Turn time based PSI writing off for encoder.
|
||||
const psiSendCount = 10
|
||||
|
@ -174,10 +173,8 @@ func TestSegment(t *testing.T) {
|
|||
|
||||
// Check that the clip data is okay.
|
||||
for i := 0; i < len(clip); i += mts.PacketSize {
|
||||
firstPkt := clip[i : i+mts.PacketSize]
|
||||
copy(pkt[:], firstPkt)
|
||||
pid := pkt.PID()
|
||||
if pid == mts.VideoPid {
|
||||
copy(pkt[:], clip[i:i+mts.PacketSize])
|
||||
if pkt.PID() == mts.VideoPid {
|
||||
payload, err := pkt.Payload()
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected err: %v\n", err)
|
||||
|
@ -206,12 +203,11 @@ 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
|
||||
tstSender := &sender{testDiscontinuities: true, discontinuityAt: clipWithDiscontinuity}
|
||||
loadSender := newMtsSender(tstSender, log)
|
||||
packer := tstPacker{rb: rb}
|
||||
encoder := mts.NewEncoder(&packer, 25)
|
||||
rb := ring.NewBuffer(rbSize, rbElementSize, wTimeout)
|
||||
encoder := mts.NewEncoder(&tstPacker{rb: rb}, 25)
|
||||
|
||||
// Turn time based PSI writing off for encoder.
|
||||
const psiSendCount = 10
|
||||
|
|
Loading…
Reference in New Issue