From 6b32064a2bdab48752ab1007b3b11051bd82f6f6 Mon Sep 17 00:00:00 2001 From: saxon Date: Tue, 5 Feb 2019 23:24:00 +1030 Subject: [PATCH] stream/mts/encoder.go: changed updateMeta signature to return bytes slice rather than passing in pointer to byte slice. --- stream/mts/encoder.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/stream/mts/encoder.go b/stream/mts/encoder.go index 0e52cb70..7bda82c7 100644 --- a/stream/mts/encoder.go +++ b/stream/mts/encoder.go @@ -216,7 +216,7 @@ func (e *Encoder) writePSI() error { if err != nil { return err } - err = updateMeta(&pmtTable) + pmtTable, err = updateMeta(pmtTable) if err != nil { 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 // contained in the global Meta struct. -func updateMeta(b *[]byte) error { - p := psi.PSIBytes(*b) +func updateMeta(b []byte) ([]byte, error) { + p := psi.PSIBytes(b) err := p.AddDescriptor(psi.MetadataTag, Meta.Encode()) - *b = []byte(p) - return err + return []byte(p), err }