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
|
||||
// addition to an mpegts packet
|
||||
func addPadding(d []byte) []byte {
|
||||
for len(d) < PktSize {
|
||||
d = append(d, 0xff)
|
||||
t := make([]byte, PacketSize)
|
||||
copy(t, d)
|
||||
padding := t[len(d):]
|
||||
for i := range padding {
|
||||
padding[i] = 0xff
|
||||
}
|
||||
return d
|
||||
}
|
||||
|
|
|
@ -26,9 +26,8 @@ LICENSE
|
|||
|
||||
package psi
|
||||
|
||||
// Misc consts
|
||||
const (
|
||||
PktSize = 184
|
||||
PacketSize = 184 // packet size of a psi.
|
||||
)
|
||||
|
||||
// Lengths of section definitions
|
||||
|
|
Loading…
Reference in New Issue