mirror of https://bitbucket.org/ausocean/av.git
packet.info renamed streamID and made a uint32 along with Conn.streamID.
This commit is contained in:
parent
de07f1ae40
commit
6959243d50
|
@ -48,7 +48,7 @@ type Conn struct {
|
|||
outChunkSize uint32
|
||||
nBytesIn uint32
|
||||
nBytesInSent uint32
|
||||
streamID int32
|
||||
streamID uint32
|
||||
serverBW uint32
|
||||
clientBW uint32
|
||||
clientBW2 uint8
|
||||
|
@ -180,7 +180,7 @@ func (c *Conn) Write(data []byte) (int, error) {
|
|||
bodySize: amf.DecodeInt24(data[1:4]),
|
||||
timestamp: amf.DecodeInt24(data[4:7]) | uint32(data[7])<<24,
|
||||
channel: chanSource,
|
||||
info: c.streamID,
|
||||
streamID: c.streamID,
|
||||
}
|
||||
|
||||
pkt.resize(pkt.bodySize, headerSizeAuto)
|
||||
|
|
|
@ -88,7 +88,7 @@ type packet struct {
|
|||
channel int32
|
||||
hasAbsTimestamp bool
|
||||
timestamp uint32
|
||||
info int32
|
||||
streamID uint32
|
||||
bodySize uint32
|
||||
bytesRead uint32
|
||||
buf []byte
|
||||
|
@ -184,7 +184,7 @@ func (pkt *packet) readFrom(c *Conn) error {
|
|||
if size > 6 {
|
||||
pkt.packetType = header[6]
|
||||
if size == 11 {
|
||||
pkt.info = int32(amf.DecodeInt32LE(header[7:11]))
|
||||
pkt.streamID = amf.DecodeInt32LE(header[7:11])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -387,7 +387,7 @@ func (pkt *packet) writeTo(c *Conn, queue bool) error {
|
|||
}
|
||||
|
||||
if headerSizes[pkt.headerType] > 8 {
|
||||
binary.LittleEndian.PutUint32(buf[headerIdx:headerIdx+4], uint32(pkt.info))
|
||||
binary.LittleEndian.PutUint32(buf[headerIdx:headerIdx+4], pkt.streamID)
|
||||
headerIdx += 4 // 32bits
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue