switch to time.Duration

This commit is contained in:
nareix 2016-06-18 10:17:29 +08:00
parent eb1fd52ef4
commit b7dc09db2f
2 changed files with 3 additions and 3 deletions

View File

@ -936,11 +936,11 @@ func (self *Client) poll() (err error) {
} }
stream := self.streams[i] stream := self.streams[i]
if stream.gotpkt { 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 { if false {
fmt.Printf("rtsp: #%d %d/%d %d\n", i, stream.timestamp, stream.Sdp.TimeScale, len(stream.pkt.Data)) 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.pkt = av.Packet{}
stream.gotpkt = false stream.gotpkt = false
return return

View File

@ -15,7 +15,7 @@ type Session struct {
type Media struct { type Media struct {
AVType string AVType string
Type int Type av.CodecType
TimeScale int TimeScale int
Control string Control string
Rtpmap int Rtpmap int