修复ssrc大小端转换bug

This commit is contained in:
夏楚 2022-02-26 22:33:00 +08:00 committed by GitHub
parent d4ffeb005a
commit db3df7b92e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -766,14 +766,14 @@ void WrappedRtxTrack::inputRtp(const char *buf, size_t len, uint64_t stamp_ms, R
void WebRtcTransportImp::onSendNack(MediaTrack &track, const FCI_NACK &nack, uint32_t ssrc) { void WebRtcTransportImp::onSendNack(MediaTrack &track, const FCI_NACK &nack, uint32_t ssrc) {
auto rtcp = RtcpFB::create(RTPFBType::RTCP_RTPFB_NACK, &nack, FCI_NACK::kSize); auto rtcp = RtcpFB::create(RTPFBType::RTCP_RTPFB_NACK, &nack, FCI_NACK::kSize);
rtcp->ssrc = htons(track.answer_ssrc_rtp); rtcp->ssrc = htonl(track.answer_ssrc_rtp);
rtcp->ssrc_media = htonl(ssrc); rtcp->ssrc_media = htonl(ssrc);
sendRtcpPacket((char *) rtcp.get(), rtcp->getSize(), true); sendRtcpPacket((char *) rtcp.get(), rtcp->getSize(), true);
} }
void WebRtcTransportImp::onSendTwcc(uint32_t ssrc, const string &twcc_fci) { void WebRtcTransportImp::onSendTwcc(uint32_t ssrc, const string &twcc_fci) {
auto rtcp = RtcpFB::create(RTPFBType::RTCP_RTPFB_TWCC, twcc_fci.data(), twcc_fci.size()); auto rtcp = RtcpFB::create(RTPFBType::RTCP_RTPFB_TWCC, twcc_fci.data(), twcc_fci.size());
rtcp->ssrc = htons(0); rtcp->ssrc = htonl(0);
rtcp->ssrc_media = htonl(ssrc); rtcp->ssrc_media = htonl(ssrc);
sendRtcpPacket((char *) rtcp.get(), rtcp->getSize(), true); sendRtcpPacket((char *) rtcp.get(), rtcp->getSize(), true);
} }