diff --git a/examples/client-read-h264/main.go b/examples/client-read-h264/main.go index b1ec1dda..16d598ea 100644 --- a/examples/client-read-h264/main.go +++ b/examples/client-read-h264/main.go @@ -39,7 +39,7 @@ func main() { // read RTP frames err = conn.ReadFrames(func(trackID int, streamType gortsplib.StreamType, payload []byte) { - if trackID == h264Track { + if streamType == gortsplib.StreamTypeRTP && trackID == h264Track { // convert RTP frames into H264 NALUs nalus, _, err := dec.Decode(payload) if err != nil {