Skip to content
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

[core] use seq larger than m_RcvBaseSeqNo to update group readablity #2026

Merged

Conversation

gou4shi1
Copy link
Contributor

Fix the issue memtioned in #1805 (comment)

@gou4shi1
Copy link
Contributor Author

For example, in this log https://1drv.ms/u/s!AuaosNlJ5ELxjy_WjKk1fnymnYGY?e=s8hn0F
grep 'TsbPd:@60' pr2026.log | grep 'belated' | grep '1770671297' | less result in

13:47:46.759400/SRT:TsbPd:@60 D:SRT.ts: @61711460:tsbpd: PLAYING PACKET seq=1770671297 (belated 75ms)
13:47:46.800792/SRT:TsbPd:@60 D:SRT.ts: @61711460:tsbpd: PLAYING PACKET seq=1770671297 (belated 116ms)
13:47:46.818400/SRT:TsbPd:@60 D:SRT.ts: @61711460:tsbpd: PLAYING PACKET seq=1770671297 (belated 134ms)
...
...
13:47:59.910359/SRT:TsbPd:@60 D:SRT.ts: @61711460:tsbpd: PLAYING PACKET seq=1770671297 (belated 13226ms)
13:47:59.920639/SRT:TsbPd:@60 D:SRT.ts: @61711460:tsbpd: PLAYING PACKET seq=1770671297 (belated 13236ms)
13:47:59.960557/SRT:TsbPd:@60 D:SRT.ts: @61711460:tsbpd: PLAYING PACKET seq=1770671297 (belated 13276ms)

@codecov-commenter

This comment has been minimized.

@maxsharabayko maxsharabayko added [core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior labels May 31, 2021
@maxsharabayko maxsharabayko added this to the v1.4.4 milestone May 31, 2021
Copy link
Collaborator

@maxsharabayko maxsharabayko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are providing the base seqno of the group's reading position to the receiver buffer when reading a packet.
If there is a packet ready to be read, but it is behind the group's base, it is just skipped (and the memory unit is freed).
Then in one call, the buffer can try to read the next packet for a group, instead of reading the first available packet in the buffer (which was already read from another socket), and waiting for another notification for read-readiness.

srtcore/buffer.h Outdated Show resolved Hide resolved
srtcore/buffer.cpp Outdated Show resolved Hide resolved
srtcore/buffer.cpp Outdated Show resolved Hide resolved
@gou4shi1
Copy link
Contributor Author

gou4shi1 commented Jun 1, 2021

You are providing the base seqno of the group's reading position to the receiver buffer when reading a packet.
If there is a packet ready to be read, but it is behind the group's base, it is just skipped (and the memory unit is freed).
Then in one call, the buffer can try to read the next packet for a group, instead of reading the first available packet in the buffer (which was already read from another socket), and waiting for another notification for read-readiness.

exactly, if the another socket is disconnected, then this socket (the first ready-to-play packet is smaller than group_base) will never get a chance to make group readable

gou4shi1 and others added 2 commits June 1, 2021 18:59
address comments

Co-authored-by: Maxim Sharabayko <maxlovic@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[core] Area: Changes in SRT library core Type: Bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants