From f8f77811ac7cc41979605e523309bb83ac9e6b3f Mon Sep 17 00:00:00 2001 From: Michael Hedrick Date: Wed, 9 Jan 2019 09:50:07 -0700 Subject: [PATCH 1/2] added back the conditional that chechecks whether a newly accumulated SCTE packet contains a payload start indicator --- packet/accumulator.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packet/accumulator.go b/packet/accumulator.go index e2d92d9..d196718 100644 --- a/packet/accumulator.go +++ b/packet/accumulator.go @@ -56,6 +56,11 @@ func (a *accumulator) Add(pkt []byte) (bool, error) { if !p || err != nil { return false, err } + // need to check if the packet contains a payloadUnitStartIndicator so we know + // to drop old packets and re-accumulate a new scte signal + if payloadUnitStartIndicator(&pp) { + a.packets = make([]*Packet, 0) + } if !payloadUnitStartIndicator(&pp) && len(a.packets) == 0 { // First packet must have payload unit start indicator return false, gots.ErrNoPayloadUnitStartIndicator From 09ff58abba9024014ca87de4c1e01e21c566520e Mon Sep 17 00:00:00 2001 From: Michael Hedrick Date: Wed, 9 Jan 2019 10:51:43 -0700 Subject: [PATCH 2/2] utilize accumulator reset func --- packet/accumulator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packet/accumulator.go b/packet/accumulator.go index d196718..a1334d1 100644 --- a/packet/accumulator.go +++ b/packet/accumulator.go @@ -59,7 +59,7 @@ func (a *accumulator) Add(pkt []byte) (bool, error) { // need to check if the packet contains a payloadUnitStartIndicator so we know // to drop old packets and re-accumulate a new scte signal if payloadUnitStartIndicator(&pp) { - a.packets = make([]*Packet, 0) + a.Reset() } if !payloadUnitStartIndicator(&pp) && len(a.packets) == 0 { // First packet must have payload unit start indicator