mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 00:37:39 +08:00
修正rtmp时间戳异常的bug
This commit is contained in:
parent
9a2d54ce9a
commit
c3231d2156
@ -93,6 +93,7 @@ public:
|
||||
uint8_t typeId;
|
||||
uint32_t bodySize = 0;
|
||||
uint32_t timeStamp = 0;
|
||||
bool hasAbsStamp = false;
|
||||
uint32_t deltaStamp = 0;
|
||||
uint32_t streamId;
|
||||
uint32_t chunkId;
|
||||
|
@ -487,6 +487,7 @@ void RtmpProtocol::handle_rtmp() {
|
||||
chunkData.chunkId = m_iNowChunkID;
|
||||
switch (iHeaderLen) {
|
||||
case 12:
|
||||
chunkData.hasAbsStamp = true;
|
||||
chunkData.streamId = load_le32(header.streamId);
|
||||
case 8:
|
||||
chunkData.bodySize = load_be24(header.bodySize);
|
||||
@ -519,7 +520,8 @@ void RtmpProtocol::handle_rtmp() {
|
||||
|
||||
if (chunkData.strBuf.size() == chunkData.bodySize) {
|
||||
//frame is ready
|
||||
chunkData.timeStamp = chunkData.deltaStamp + (iHeaderLen == 12 ? 0 : chunkData.timeStamp);
|
||||
chunkData.timeStamp = chunkData.deltaStamp + (chunkData.hasAbsStamp ? 0 : chunkData.timeStamp);
|
||||
chunkData.hasAbsStamp = false;
|
||||
m_iNowStreamID = chunkData.streamId;
|
||||
if(chunkData.bodySize){
|
||||
handle_rtmpChunk(chunkData);
|
||||
|
Loading…
Reference in New Issue
Block a user