mirror of https://bitbucket.org/ausocean/av.git
Simplified code
This commit is contained in:
parent
6b2644a517
commit
05b9416aa4
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue