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] Fixed SRTO_KM* options setting. #1922

Merged
merged 2 commits into from
Apr 9, 2021

Conversation

maxsharabayko
Copy link
Collaborator

@maxsharabayko maxsharabayko commented Apr 7, 2021

This PR fixes/changes:

  • Rejecting negative values (as not allowed).
  • Handling zero value properly (as the default). Previously setting SRTO_KMREFRESHRATE=0 was changing SRTO_KMPREANNOUNCE=0x7fffffff.
  • SRTO_KMREFRESHRATE and SRTO_KMPREANNOUNCE and not readable (as was already stated in the docs).
  • Updated docs: described the default 0 value meaning.

The default values of both SRTO_KMREFRESHRATE and SRTO_KMPREANNOUNCE is zero. It is treated as:

  • SRTO_KMREFRESHRATE = 0x1000000
  • SRTO_KMPREANNOUNCE= 0x1000

TODO

  • Consider restricting setting and/or getting zero value. Use the actual default instead? Decision: stay compliant to the rest options.
  • Fix warning: comparison of integers of different signs: 'const unsigned int' and 'int' [-Wsign-compare]
    if (km_preanno > (kmref - 1) / 2)

@maxsharabayko maxsharabayko added Type: Bug Indicates an unexpected problem or unintended behavior [core] Area: Changes in SRT library core labels Apr 7, 2021
@maxsharabayko maxsharabayko added this to the v1.4.3 milestone Apr 7, 2021
docs/API/API-socket-options.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@stevomatthews stevomatthews left a comment

Choose a reason for hiding this comment

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

No changes.

@maxsharabayko maxsharabayko marked this pull request as ready for review April 9, 2021 12:57
Rejecting negative values.
Handling zero value properly (as the default).
Updated docs.
@maxsharabayko maxsharabayko force-pushed the hotfix/sockopt_km branch 2 times, most recently from 50a642d to 758784d Compare April 9, 2021 13:26
@maxsharabayko maxsharabayko merged commit 98649a6 into Haivision:master Apr 9, 2021
@maxsharabayko maxsharabayko deleted the hotfix/sockopt_km branch April 9, 2021 15:15
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