1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

refine protocol send. add utest for server auto response message

This commit is contained in:
winlin 2014-07-12 07:41:52 +08:00
parent 9556790a5e
commit f7922e3823
2 changed files with 200 additions and 8 deletions

View file

@ -460,15 +460,15 @@ int SrsProtocol::do_send_message(SrsMessage* msg, SrsPacket* packet)
// chunk message header, 11 bytes
// timestamp, 3bytes, big-endian
u_int32_t timestamp = (u_int32_t)msg->header.timestamp;
if (timestamp >= RTMP_EXTENDED_TIMESTAMP) {
*pheader++ = 0xFF;
*pheader++ = 0xFF;
*pheader++ = 0xFF;
} else {
if (timestamp < RTMP_EXTENDED_TIMESTAMP) {
pp = (char*)&timestamp;
*pheader++ = pp[2];
*pheader++ = pp[1];
*pheader++ = pp[0];
} else {
*pheader++ = 0xFF;
*pheader++ = 0xFF;
*pheader++ = 0xFF;
}
// message_length, 3bytes, big-endian