fix g711 timestamp
This commit is contained in:
parent
b7dc09db2f
commit
b3684fb382
14
client.go
14
client.go
@ -936,9 +936,19 @@ func (self *Client) poll() (err error) {
|
|||||||
}
|
}
|
||||||
stream := self.streams[i]
|
stream := self.streams[i]
|
||||||
if stream.gotpkt {
|
if stream.gotpkt {
|
||||||
tm := time.Duration(stream.timestamp)*time.Second / time.Duration(stream.Sdp.TimeScale)
|
timeScale := stream.Sdp.TimeScale
|
||||||
|
|
||||||
|
if timeScale == 0 {
|
||||||
|
/*
|
||||||
|
https://tools.ietf.org/html/rfc5391
|
||||||
|
The RTP timestamp clock frequency is the same as the default sampling frequency: 16 kHz.
|
||||||
|
*/
|
||||||
|
timeScale = 16000
|
||||||
|
}
|
||||||
|
|
||||||
|
tm := time.Duration(stream.timestamp)*time.Second / time.Duration(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, timeScale, len(stream.pkt.Data))
|
||||||
}
|
}
|
||||||
self.pktque.WriteTimePacket(self.setupMap[i], tm, stream.pkt)
|
self.pktque.WriteTimePacket(self.setupMap[i], tm, stream.pkt)
|
||||||
stream.pkt = av.Packet{}
|
stream.pkt = av.Packet{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user