From bfd03137769168706d7d0865940fdf61012be378 Mon Sep 17 00:00:00 2001 From: Saxon Milton Date: Tue, 12 Dec 2017 09:40:30 +1030 Subject: [PATCH] Just updating remote --- packet/MpegTs.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packet/MpegTs.go b/packet/MpegTs.go index 3e7fe654..fc61d2f2 100644 --- a/packet/MpegTs.go +++ b/packet/MpegTs.go @@ -70,12 +70,14 @@ type MpegTsPacket struct { Payload []byte } -func boolToUint( in bool ) (out uint){ +func boolToByte( in bool ) (out uint){ if in { out = 1 } 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[1] = + output[1] =( boolToByte(TEI) << (8-TEIIndex%8) ) | ( boolToByte(PUSI) << (8-PUSIIndex%8) ) | + ( boolToByte(Priority) << (8-PriorityIndex%8) ) }