-
Notifications
You must be signed in to change notification settings - Fork 83
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
jbuf: frame fixes #806
jbuf: frame fixes #806
Conversation
be7bb95
to
98a7ea6
Compare
Since packets can be lost or late/reorderd, this can lead to multiple counting.
98a7ea6
to
8686db6
Compare
if (f->le.prev) { | ||
struct packet *pre_f = f->le.prev->data; | ||
jb->nf = 1; | ||
LIST_FOREACH(&jb->packetl, le) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to avoid O(n)
effort for jbuf_put()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not found a reliable way. Out-of-order, delayed packets lead to double or missed frame counts, and incorrect frame counts have a big impact on latency and jitter calculations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way maybe could a separate list with frame timestamps
Edit: but this optimizes only video frame counting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The packets are inserted sorted by the sequence number. The sorted insert needs normally only one to a few checks.
Timestamps and sequence number should have the same order. So after the insert only one or a few checks are needed to find packets with same timestamp. Did I miss something?
Edit: I'll try a PR draft for a closer look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Draft: #821
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is, we don't know if a sequence number is missing, because its lost or because it arrives later. This makes a simple increment unreliable. Maybe a list of missing sequence numbers can work. I plan to add RTCP Feedback NACK
to trigger a resend for missing packets (video only).
Since packets can be lost or late/reordered, this can lead to multiple counting.