diff --git a/doc.txt b/doc.txt index 484f07c..0d698ce 100644 --- a/doc.txt +++ b/doc.txt @@ -33,6 +33,8 @@ The first h264 packet [h264 @ 0x7fdf01802200] NAL 5(IDR) at 79/279 length 124 [h264 @ 0x7fdf01802200] NAL 5(IDR) at 207/279 length 71 +AUD is a must for QuickTime player. + NAL_SLICE = 1, NAL_DPA = 2, NAL_DPB = 3, diff --git a/example/test.go b/example/test.go index c2e3bf6..5f93a95 100644 --- a/example/test.go +++ b/example/test.go @@ -35,7 +35,8 @@ func readSamples(filename string, ch chan Sample) { close(ch) }() - debug := false + debugData := true + debugStream := false var file *os.File var err error @@ -70,8 +71,6 @@ func readSamples(filename string, ch chan Sample) { return } - debugStream := false - onStreamPayload := func() (err error) { stream := findOrCreateStream(header.PID) r := bytes.NewReader(payload) @@ -94,7 +93,7 @@ func readSamples(filename string, ch chan Sample) { } if stream.Data.Len() == int(stream.PESHeader.DataLength) { - if debug { + if debugData { fmt.Println(stream.Type, stream.Title, stream.Data.Len(), "total") fmt.Println(hex.Dump(stream.Data.Bytes())) } @@ -114,7 +113,7 @@ func readSamples(filename string, ch chan Sample) { if header, n, err = ts.ReadTSPacket(file, data[:]); err != nil { return } - if debug { + if debugData { fmt.Println(header, n) } @@ -134,9 +133,6 @@ func readSamples(filename string, ch chan Sample) { return } //fmt.Println("pmt", pmt) - if debug { - fmt.Println(hex.Dump(payload)) - } } }