diff --git a/generator/mpegts_generator.go b/generator/mpegts_generator.go index 5487620b..6917516b 100644 --- a/generator/mpegts_generator.go +++ b/generator/mpegts_generator.go @@ -31,7 +31,7 @@ import ( "bitbucket.org/ausocean/av/pes" ) -const mpegtsPacketSize = 184 +const psiPacketSize = 184 // TODO: really need to finish the at and pmt stuff - this is too hacky var ( @@ -43,10 +43,10 @@ var ( // with 0xFFs - because it looks ugly to hardcode above. This is called through // NewMpegtsgenerator func genPatAndPmt() { - for len(patTable) < mpegtsPacketSize { + for len(patTable) < psiPacketSize { patTable = append(patTable, 255) } - for len(pmtTable) < mpegtsPacketSize { + for len(pmtTable) < psiPacketSize { pmtTable = append(pmtTable, 255) } } @@ -160,10 +160,10 @@ func (g *tsGenerator) generate() { Data: nalUnit, HeaderLength: 5, } - g.pesPktChan <- pesPkt.ToByteSlice() - case pesPkt := <-g.pesPktChan: - for ii := range pesPkt { - g.payloadByteChan <- pesPkt[ii] + pesPktSlice := pesPkt.ToByteSlice() + + for ii := range pesPktSlice { + g.payloadByteChan <- pesPktSlice[ii] } pusi := true for len(g.payloadByteChan) > 0 {