Comments (9)
but how about sequence reset ?
from mediasoup.
right,my mistake
from mediasoup.
Nope, that's why just above that block we check received sequence manager with SeqManager
utility:
// If the wide sequence number of the new packet is lower than the latest
// seen, ignore it.
// NOTE: Not very spec compliant but libwebrtc does it.
// Also ignore if the sequence number matches the latest seen.
if (!RTC::SeqManager<uint16_t>::IsSeqHigherThan(sequenceNumber, this->latestSequenceNumber))
{
return AddPacketResult::SUCCESS;
}
// Check if there are too many missing packets.
{
auto missingPackets = sequenceNumber - (this->latestSequenceNumber + 1);
if (missingPackets > FeedbackRtpTransportPacket::maxMissingPackets)
{
MS_WARN_DEV("RTP missing packet number exceeded");
return AddPacketResult::FATAL;
}
}
from mediasoup.
but how about sequence reset ?
What is sequence reset? When seq number reaches max number 65535 and next packet has seq number 0?
Well, that's exactly what RTC::SeqManager<uint16_t>::IsSeqHigherThan()
cares about.
from mediasoup.
Yes, IsSeqHigherThan
get true ,but missingPackets
get wrong result.
from mediasoup.
Actually this is indeed wrong, but not sure if you are pointing to the real problem which is the usage of auto
:
#include <cinttypes> // PRIu64, etc
#include <cstddef> // size_t
#include <cstdint> // uint8_t, etc
#include <cstdio>
int main() {
uint16_t sequenceNumber = 0;
uint16_t latestSequenceNumber = 65535;
auto missingPackets = sequenceNumber - (latestSequenceNumber + 1);
printf("missingPackets: %" PRIu16 "\n", missingPackets);
return 0;
}
missingPackets: 4294901760
#include <cinttypes> // PRIu64, etc
#include <cstddef> // size_t
#include <cstdint> // uint8_t, etc
#include <cstdio>
int main() {
uint16_t sequenceNumber = 0;
uint16_t latestSequenceNumber = 65535;
uint16_t missingPackets = sequenceNumber - (latestSequenceNumber + 1);
printf("missingPackets: %" PRIu16 "\n", missingPackets);
return 0;
}
missingPackets: 0
from mediasoup.
Not familiar with c++,But yes, auto is the real problem 👍
from mediasoup.
uint16 minus will overflow too
from mediasoup.
uint16 minus will overflow too
It wont. If I am wrong please be more explicit.
BTW as shown above:
#include <cinttypes> // PRIu64, etc
#include <cstddef> // size_t
#include <cstdint> // uint8_t, etc
#include <cstdio>
int main() {
uint16_t sequenceNumber = 0;
uint16_t latestSequenceNumber = 65535;
uint16_t missingPackets = sequenceNumber - (latestSequenceNumber + 1);
printf("missingPackets: %" PRIu16 "\n", missingPackets);
return 0;
}
missingPackets: 0
from mediasoup.
Related Issues (20)
- Possible missing break in H264_SVC::ParseSingleNalu()
- Must join all XxxConsumer classes into a single one
- set MS_LOG_DEV_LEVEL 3, lead to build errors HOT 1
- #define MS_LOG_DEV_LEVEL 3, build error HOT 1
- SeqManager<T>::SeqLowerThan() crashes when used as compare function in abseil set or map (only in debug mode) HOT 24
- Use uint64_t for containers with RTP seq number as key
- arm64 prebuilt binaries are replacing x64 ones HOT 4
- test-PipeTransport.ts randomly fails HOT 2
- RtpPacket::SetPayloadLength get wrong payloadLength HOT 2
- Possible memory leak HOT 34
- DataConsumer::SendMessage cause onQueuedCallback* cb leak and DATACONSUMER_SEND have no response HOT 1
- Worker crash when closing `WebRtcServer` if there are TCP connections active HOT 2
- Mediasoup worker died, exiting in 2 seconds... HOT 2
- [Rust] Error log “XXX closing failed on drop: Channel already closed”
- Add interface for RTC::Shared, Channel::ChannelNotifier and ChannelMessageRegistrator HOT 3
- [Rust] Transport with only audio producer results in server-side transport cc is not created. HOT 2
- Bug Simulcast plainTransport -> webrtcTransport HOT 5
- Video software encoding Quality Limitation vs hardware encoding HOT 1
- Ci tests fail consistently in Windows (Node and Rust)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mediasoup.