From b7dc09db2f9d59c1cddc6a6c1e03f434ae6eb40e Mon Sep 17 00:00:00 2001 From: nareix Date: Sat, 18 Jun 2016 10:17:29 +0800 Subject: [PATCH] switch to time.Duration --- client.go | 4 ++-- sdp/parser.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client.go b/client.go index e63a81b..93d5473 100644 --- a/client.go +++ b/client.go @@ -936,11 +936,11 @@ func (self *Client) poll() (err error) { } stream := self.streams[i] if stream.gotpkt { - time := float64(stream.timestamp) / float64(stream.Sdp.TimeScale) + tm := time.Duration(stream.timestamp)*time.Second / time.Duration(stream.Sdp.TimeScale) if false { fmt.Printf("rtsp: #%d %d/%d %d\n", i, stream.timestamp, stream.Sdp.TimeScale, len(stream.pkt.Data)) } - self.pktque.WriteTimePacket(self.setupMap[i], time, stream.pkt) + self.pktque.WriteTimePacket(self.setupMap[i], tm, stream.pkt) stream.pkt = av.Packet{} stream.gotpkt = false return diff --git a/sdp/parser.go b/sdp/parser.go index 3dc587d..925d9eb 100644 --- a/sdp/parser.go +++ b/sdp/parser.go @@ -15,7 +15,7 @@ type Session struct { type Media struct { AVType string - Type int + Type av.CodecType TimeScale int Control string Rtpmap int