Skip to content

Commit

Permalink
Merge pull request #116 from mhedrick843/duplicate-SCTE-bugfix
Browse files Browse the repository at this point in the history
added back the conditional that checks whether a newly accumulated…
  • Loading branch information
WillGunther committed Jan 11, 2019
2 parents c9e8466 + 36fe21c commit 98e2882
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packet/accumulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.Reset()
}
if !payloadUnitStartIndicator(&pp) && len(a.packets) == 0 {
// First packet must have payload unit start indicator
return false, gots.ErrNoPayloadUnitStartIndicator
Expand Down

0 comments on commit 98e2882

Please sign in to comment.