Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions descriptors.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cuei

import (
"fmt"
"log"
)

// audioCmpt is a struct for audioDscptr Components
Expand Down Expand Up @@ -55,16 +56,15 @@ type Descriptor struct {
}

// Return Descriptor as JSON
func (dscptr *Descriptor)Json() string{
return mkJson(dscptr)
func (dscptr *Descriptor) Json() string {
return mkJson(dscptr)
}

// Print Descriptor as JSON
func (dscptr *Descriptor)Show(){
func (dscptr *Descriptor) Show() {
fmt.Printf(dscptr.Json())
}


/*
*
Decode returns a Splice Descriptor by tag.
Expand Down Expand Up @@ -154,6 +154,9 @@ func (dscptr *Descriptor) segmentationDescriptor(bd *bitDecoder, tag uint8, leng
dscptr.Tag = tag
dscptr.Length = length
dscptr.Identifier = bd.asAscii(32)
if dscptr.Identifier != "CUEI" {
log.Fatal("Segmentation Descriptor Identifies is not 0x43554549 but is ", dscptr.Identifier)
}
dscptr.Name = "Segmentation Descriptor"
dscptr.SegmentationEventID = bd.asHex(32)
dscptr.SegmentationEventCancelIndicator = bd.asFlag()
Expand Down
6 changes: 6 additions & 0 deletions section.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@ func (infosec *InfoSection) Decode(bd *bitDecoder) bool {
}
infosec.SectionSyntaxIndicator = bd.asFlag()
infosec.Private = bd.asFlag()
if infosec.Private {
return false
}
Copy link
Owner

@futzu futzu Aug 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct, as far as the specification goes, but this gets us nothing, I've never seen this value used, and that's why Intentionally don't check it.

infosec.Reserved = bd.asHex(2)
infosec.SectionLength = bd.uInt16(12)
infosec.ProtocolVersion = bd.uInt8(8)
if infosec.ProtocolVersion != 0 {
return false
}
infosec.EncryptedPacket = bd.asFlag()
infosec.EncryptionAlgorithm = bd.uInt8(6)
infosec.PtsAdjustment = bd.as90k(33)
Expand Down