-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"invalid TMMB bitrate value" #89
Comments
The value may indeed be invalid :-). I'll check it. |
NOTE: I also see this:
|
It's Okey, the useful info is in the packet items, which contains the SSRCs they refer to, each. This packet type to be properly handled (forwarded) as commented this morning. |
opps, ok ok, sorry. |
I don't think this is ok: template <typename T>
FeedbackRtpTmmbItem<T>::FeedbackRtpTmmbItem(const uint8_t* data)
{
this->ssrc = Utils::Byte::Get4Bytes(data, 0);
// Read the 4 bytes block.
uint32_t compact = Utils::Byte::Get4Bytes(data, 4);
// Read each component.
uint8_t exponent = compact >> 26; // 6 bits.
uint64_t mantissa = (compact >> 9) & 0x1ffff; // 17 bits.
this-> overhead = compact & 0x1ff; // 9 bits. Here we are reading bytes from 5 to 8 as a |
What mostly worries me (but I'd may be 100% wrong) is this: template <typename T>
FeedbackRtpTmmbItem<T>::FeedbackRtpTmmbItem(const uint8_t* data)
{
this->ssrc = Utils::Byte::Get4Bytes(data, 0);
// Read the 4 bytes block.
uint32_t compact = Utils::Byte::Get4Bytes(data, 4);
// Read each component.
uint8_t exponent = compact >> 26; // 6 bits.
uint64_t mantissa = (compact >> 9) & 0x1ffff; // 17 bits.
this-> overhead = compact & 0x1ff; // 9 bits.
// Get the bitrate out of exponent and mantissa.
this->bitrate = (mantissa << exponent);
if ((this->bitrate >> exponent) != mantissa)
{
MS_WARN_TAG(rtcp, "invalid TMMB bitrate value : %" PRIu64" *2^%" PRIu8, mantissa, exponent);
this->isCorrect = false;
}
} I mean: that seems to be a pure mathematical assertion, how can it be wrong? |
That check it to prevent shift overflows. Ie:
mantissa = 43461 bitrate = mantissa << exponent = 9223372036854775807 (in a uint64_t) |
Closing due to same reasons as those in #93 |
In master branch:
The text was updated successfully, but these errors were encountered: