mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-24 19:50:38 +08:00
Compare commits
1 Commits
073700b6bc
...
6a3af7ba14
Author | SHA1 | Date | |
---|---|---|---|
|
6a3af7ba14 |
@ -247,8 +247,7 @@ bool MP4MuxerMemory::inputFrame(const Frame::Ptr &frame) {
|
|||||||
_key_frame = false;
|
_key_frame = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// only audio all frame is key frame
|
if (frame->keyFrame()) {
|
||||||
if (frame->keyFrame() || !haveVideo()) {
|
|
||||||
_key_frame = true;
|
_key_frame = true;
|
||||||
}
|
}
|
||||||
if (frame->getTrackType() == TrackVideo || !haveVideo()) {
|
if (frame->getTrackType() == TrackVideo || !haveVideo()) {
|
||||||
|
@ -292,8 +292,8 @@ bool HandshakePacket::loadFromData(uint8_t *buf, size_t len) {
|
|||||||
syn_cookie = loadUint32(ptr);
|
syn_cookie = loadUint32(ptr);
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
|
|
||||||
memcpy(peer_ip_addr, ptr, sizeof(peer_ip_addr));
|
memcpy(peer_ip_addr, ptr, sizeof(peer_ip_addr) * sizeof(peer_ip_addr[0]));
|
||||||
ptr += sizeof(peer_ip_addr);
|
ptr += sizeof(peer_ip_addr) * sizeof(peer_ip_addr[0]);
|
||||||
|
|
||||||
if (encryption_field != NO_ENCRYPTION) {
|
if (encryption_field != NO_ENCRYPTION) {
|
||||||
ErrorL << "not support encryption " << encryption_field;
|
ErrorL << "not support encryption " << encryption_field;
|
||||||
@ -400,8 +400,8 @@ bool HandshakePacket::storeToData() {
|
|||||||
storeUint32(ptr, syn_cookie);
|
storeUint32(ptr, syn_cookie);
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
|
|
||||||
memcpy(ptr, peer_ip_addr, sizeof(peer_ip_addr));
|
memcpy(ptr, peer_ip_addr, sizeof(peer_ip_addr) * sizeof(peer_ip_addr[0]));
|
||||||
ptr += sizeof(peer_ip_addr);
|
ptr += sizeof(peer_ip_addr) * sizeof(peer_ip_addr[0]);
|
||||||
|
|
||||||
if (encryption_field != NO_ENCRYPTION) {
|
if (encryption_field != NO_ENCRYPTION) {
|
||||||
ErrorL << "not support encryption " << encryption_field;
|
ErrorL << "not support encryption " << encryption_field;
|
||||||
@ -433,7 +433,7 @@ uint32_t HandshakePacket::getSynCookie(uint8_t *buf, size_t len) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void HandshakePacket::assignPeerIP(struct sockaddr_storage *addr) {
|
void HandshakePacket::assignPeerIP(struct sockaddr_storage *addr) {
|
||||||
memset(peer_ip_addr, 0, sizeof(peer_ip_addr));
|
memset(peer_ip_addr, 0, sizeof(peer_ip_addr) * sizeof(peer_ip_addr[0]));
|
||||||
if (addr->ss_family == AF_INET) {
|
if (addr->ss_family == AF_INET) {
|
||||||
struct sockaddr_in *ipv4 = (struct sockaddr_in *)addr;
|
struct sockaddr_in *ipv4 = (struct sockaddr_in *)addr;
|
||||||
// 抓包 奇怪好像是小头端??? [AUTO-TRANSLATED:40eb164c]
|
// 抓包 奇怪好像是小头端??? [AUTO-TRANSLATED:40eb164c]
|
||||||
@ -446,7 +446,7 @@ void HandshakePacket::assignPeerIP(struct sockaddr_storage *addr) {
|
|||||||
storeUint32LE(peer_ip_addr, addr4.s_addr);
|
storeUint32LE(peer_ip_addr, addr4.s_addr);
|
||||||
} else {
|
} else {
|
||||||
const sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)addr;
|
const sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)addr;
|
||||||
memcpy(peer_ip_addr, ipv6->sin6_addr.s6_addr, sizeof(peer_ip_addr));
|
memcpy(peer_ip_addr, ipv6->sin6_addr.s6_addr, sizeof(peer_ip_addr) * sizeof(peer_ip_addr[0]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ void SrtTransport::handleHandshakeInduction(HandshakePacket &pkt, struct sockadd
|
|||||||
res->srt_socket_id = _peer_socket_id;
|
res->srt_socket_id = _peer_socket_id;
|
||||||
res->syn_cookie = HandshakePacket::generateSynCookie(addr, _start_timestamp);
|
res->syn_cookie = HandshakePacket::generateSynCookie(addr, _start_timestamp);
|
||||||
_sync_cookie = res->syn_cookie;
|
_sync_cookie = res->syn_cookie;
|
||||||
memcpy(res->peer_ip_addr, pkt.peer_ip_addr, sizeof(pkt.peer_ip_addr));
|
memcpy(res->peer_ip_addr, pkt.peer_ip_addr, sizeof(pkt.peer_ip_addr) * sizeof(pkt.peer_ip_addr[0]));
|
||||||
_handleshake_res = res;
|
_handleshake_res = res;
|
||||||
res->storeToData();
|
res->storeToData();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user