rename
This commit is contained in:
parent
57fa27e32d
commit
8493b20b5e
@ -142,6 +142,7 @@ func (self *Server) ListenAndServe() (err error) {
|
|||||||
|
|
||||||
type stream struct {
|
type stream struct {
|
||||||
codec av.CodecData
|
codec av.CodecData
|
||||||
|
lasttime time.Duration
|
||||||
}
|
}
|
||||||
|
|
||||||
func newStream(codec av.CodecData) *stream {
|
func newStream(codec av.CodecData) *stream {
|
||||||
@ -972,28 +973,30 @@ func (self *Conn) writeChunks(csid uint32, timestamp uint32, msgtypeid uint8, ms
|
|||||||
msghdrtype := 0
|
msghdrtype := 0
|
||||||
var tsdelta uint32
|
var tsdelta uint32
|
||||||
|
|
||||||
cs := self.writecsmap[csid]
|
if false { // always msghdrtype==1 is ok
|
||||||
if cs == nil {
|
cs := self.writecsmap[csid]
|
||||||
cs = &chunkStream{}
|
if cs == nil {
|
||||||
self.writecsmap[csid] = cs
|
cs = &chunkStream{}
|
||||||
} else {
|
self.writecsmap[csid] = cs
|
||||||
if msgsid == cs.msgsid {
|
} else {
|
||||||
if uint32(msgdatalen) == cs.msgdatalen && msgtypeid == cs.msgtypeid {
|
if msgsid == cs.msgsid {
|
||||||
if timestamp == cs.timenow {
|
if uint32(msgdatalen) == cs.msgdatalen && msgtypeid == cs.msgtypeid {
|
||||||
msghdrtype = 3
|
if timestamp == cs.timenow {
|
||||||
|
msghdrtype = 3
|
||||||
|
} else {
|
||||||
|
msghdrtype = 2
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
msghdrtype = 2
|
msghdrtype = 1
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
msghdrtype = 1
|
|
||||||
}
|
}
|
||||||
|
tsdelta = timestamp - cs.timenow
|
||||||
}
|
}
|
||||||
tsdelta = timestamp - cs.timenow
|
cs.timenow = timestamp
|
||||||
|
cs.msgdatalen = uint32(msgdatalen)
|
||||||
|
cs.msgtypeid = msgtypeid
|
||||||
|
cs.msgsid = msgsid
|
||||||
}
|
}
|
||||||
cs.timenow = timestamp
|
|
||||||
cs.msgdatalen = uint32(msgdatalen)
|
|
||||||
cs.msgtypeid = msgtypeid
|
|
||||||
cs.msgsid = msgsid
|
|
||||||
|
|
||||||
if err = self.bw.WriteU8(byte(csid)&0x3f|byte(msghdrtype)<<6); err != nil {
|
if err = self.bw.WriteU8(byte(csid)&0x3f|byte(msghdrtype)<<6); err != nil {
|
||||||
return
|
return
|
Loading…
x
Reference in New Issue
Block a user