mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
fix streamid zero error
This commit is contained in:
parent
91aa9c494c
commit
af9bd2dd0a
@ -81,7 +81,9 @@ bool HSExtStreamID::loadFromData(uint8_t *buf, size_t len) {
|
||||
ptr+=4;
|
||||
}
|
||||
char zero = 0x00;
|
||||
if(streamid.back() == zero){
|
||||
streamid.erase(streamid.find_first_of(zero),streamid.size());
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,10 @@ using namespace mediakit;
|
||||
SrtSession::SrtSession(const Socket::Ptr &sock)
|
||||
: UdpSession(sock) {
|
||||
socklen_t addr_len = sizeof(_peer_addr);
|
||||
memset(&_peer_addr,0,addr_len);
|
||||
TraceL<<"before addr len "<<addr_len;
|
||||
getpeername(sock->rawFD(), (struct sockaddr *)&_peer_addr, &addr_len);
|
||||
TraceL<<"after addr len "<<addr_len<<" family "<<_peer_addr.ss_family;
|
||||
}
|
||||
|
||||
SrtSession::~SrtSession() {
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "Util/onceToken.h"
|
||||
#include <stdlib.h>
|
||||
#include "Util/onceToken.h"
|
||||
|
||||
#include "SrtTransport.hpp"
|
||||
#include "Packet.hpp"
|
||||
@ -297,7 +298,7 @@ void SrtTransport::handleACKACK(uint8_t *buf, int len, struct sockaddr_storage *
|
||||
pkt->loadFromData(buf,len);
|
||||
|
||||
uint32_t rtt = DurationCountMicroseconds(_now - _ack_send_timestamp[pkt->ack_number]);
|
||||
_rtt_variance = (3*_rtt_variance+abs(_rtt - rtt))/4;
|
||||
_rtt_variance = (3*_rtt_variance+abs((long)(_rtt - rtt)))/4;
|
||||
_rtt = (7*rtt+_rtt)/8;
|
||||
|
||||
_ack_send_timestamp.erase(pkt->ack_number);
|
||||
|
Loading…
Reference in New Issue
Block a user