examples: fix client-read-format-h264-save-to-disk example

This commit is contained in:
aler9
2023-01-03 16:22:00 +01:00
parent ab0c73c8d8
commit 62296a3eca

View File

@@ -62,7 +62,8 @@ func main() {
// called when a RTP packet arrives
c.OnPacketRTP(medi, forma, func(pkt *rtp.Packet) {
// convert RTP packets into NALUs
nalus, pts, err := rtpDec.Decode(pkt)
// DecodeUntilMarker is necessary for the DTS extractor to work
nalus, pts, err := rtpDec.DecodeUntilMarker(pkt)
if err != nil {
if err != rtph264.ErrNonStartingPacketAndNoPrevious && err != rtph264.ErrMorePacketsNeeded {
log.Printf("ERR: %v", err)