stream/mts/encoder.go: changed updateMeta signature to return bytes slice rather than passing in pointer to byte slice.

This commit is contained in:
saxon 2019-02-05 23:24:00 +10:30
parent dc46d9f0b2
commit 6b32064a2b
1 changed files with 4 additions and 5 deletions

View File

@ -216,7 +216,7 @@ func (e *Encoder) writePSI() error {
if err != nil { if err != nil {
return err return err
} }
err = updateMeta(&pmtTable) pmtTable, err = updateMeta(pmtTable)
if err != nil { if err != nil {
return err return err
} }
@ -262,9 +262,8 @@ func (e *Encoder) ccFor(pid int) byte {
// updateMeta adds/updates a metaData descriptor in the given psi bytes using data // updateMeta adds/updates a metaData descriptor in the given psi bytes using data
// contained in the global Meta struct. // contained in the global Meta struct.
func updateMeta(b *[]byte) error { func updateMeta(b []byte) ([]byte, error) {
p := psi.PSIBytes(*b) p := psi.PSIBytes(b)
err := p.AddDescriptor(psi.MetadataTag, Meta.Encode()) err := p.AddDescriptor(psi.MetadataTag, Meta.Encode())
*b = []byte(p) return []byte(p), err
return err
} }