just getting a record

This commit is contained in:
Unknown 2017-12-14 12:43:51 +10:30
parent f91c5f2c97
commit 067b36b1cd
2 changed files with 7 additions and 4 deletions

View File

@ -28,6 +28,8 @@ LICENSE
package packets
import "fmt"
type RtpToTsConverter interface {
Convert()
}
@ -64,7 +66,7 @@ func (c* rtpToTsConverter) Convert(rtpSession *Session) {
c.currentTsPacket = new(MpegTsPacket)
c.currentTsPacket.SyncByte = 0x47
c.currentTsPacket.TEI = false
if lengthOfByteChan == len(rtpPacket.Payload) {
if lengthOfByteChan == len(rtpPacket.Payload) { // if it's the start of the payload
c.currentTsPacket.PUSI = true
} else {
c.currentTsPacket.PUSI = false

View File

@ -426,10 +426,11 @@ func checkContinuityCounts(clip []byte) error {
// sendClipToStdout dumps video stats to stdout.
func sendClipToStdout(clip []byte, _ string, _ net.Conn) error {
fmt.Printf("Dumping clip (%d bytes)\n", len(clip))
/*
if *flags&dumpProgramInfo != 0 {
return mp2tDumpProgram(clip)
}
*/
packetCount := 0
discontinuities := 0
@ -472,9 +473,9 @@ func sendClipToStdout(clip []byte, _ string, _ net.Conn) error {
}
dumpCC = (cc + 1) % 16
if *flags&dumpPacketHeader != 0 {
//if *flags&dumpPacketHeader != 0 {
fmt.Printf("\t\tTEI=%d, PUSI=%d, TP=%d, TSC=%d, AFC=%d, CC=%d\n", tei, pusi, tp, tcs, afc, cc)
}
//}
if afc == 3 {
// adaptation field, followed by payload