Just updating remote

This commit is contained in:
Saxon Milton 2017-12-12 09:40:30 +10:30
parent 42b53917b9
commit bfd0313776
1 changed files with 5 additions and 3 deletions

View File

@ -70,12 +70,14 @@ type MpegTsPacket struct {
Payload []byte Payload []byte
} }
func boolToUint( in bool ) (out uint){ func boolToByte( in bool ) (out uint){
if in { out = 1 } if in { out = 1 }
return return
} }
func (p *MpegTsPacket) toByteSlice() (output []byte) { // bool to int, shift accordigly, int to string, string binary to int
func (p *MpegTsPacket) toByteSlice() (output [188]byte) {
output[0] = p.SyncByte output[0] = p.SyncByte
output[1] = output[1] =( boolToByte(TEI) << (8-TEIIndex%8) ) | ( boolToByte(PUSI) << (8-PUSIIndex%8) ) |
( boolToByte(Priority) << (8-PriorityIndex%8) )
} }