mirror of https://bitbucket.org/ausocean/av.git
psi: modified addPadding to only do one resize
This commit is contained in:
parent
46f5ffd6f2
commit
c4e2ca64a9
|
@ -132,8 +132,11 @@ func trimTo(d []byte, t byte) []byte {
|
||||||
// addPadding adds an appropriate amount of padding to a pat or pmt table for
|
// addPadding adds an appropriate amount of padding to a pat or pmt table for
|
||||||
// addition to an mpegts packet
|
// addition to an mpegts packet
|
||||||
func addPadding(d []byte) []byte {
|
func addPadding(d []byte) []byte {
|
||||||
for len(d) < PktSize {
|
t := make([]byte, PacketSize)
|
||||||
d = append(d, 0xff)
|
copy(t, d)
|
||||||
|
padding := t[len(d):]
|
||||||
|
for i := range padding {
|
||||||
|
padding[i] = 0xff
|
||||||
}
|
}
|
||||||
return d
|
return d
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,9 +26,8 @@ LICENSE
|
||||||
|
|
||||||
package psi
|
package psi
|
||||||
|
|
||||||
// Misc consts
|
|
||||||
const (
|
const (
|
||||||
PktSize = 184
|
PacketSize = 184 // packet size of a psi.
|
||||||
)
|
)
|
||||||
|
|
||||||
// Lengths of section definitions
|
// Lengths of section definitions
|
||||||
|
|
Loading…
Reference in New Issue