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

libobs/frontend: Add callback for reconnection decision #11925

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dsaedtler
Copy link
Contributor

@dsaedtler dsaedtler commented Mar 5, 2025

Description

Adds a callback for making reconnection decision.

Also reverts #11304

Motivation and Context

#11304 was necessary for #11452, but negatively impacted regular users as some servers would not accept a reconnection attempt after the default retry time (2 seconds), which resulted in some users seeing a warning message instead of automatic reconnection.

To restore the old behaviour, we instead add a new callback that makes it a decision by the output's creator on whether or not they want to allow a reconnect attempt.

In addition to a simple yes/no decision this also allows reconfiguring the output in the callback, allowing for a futrue rework of #11452 that does not rely on the somewhat ugly UI changes to hijack the regular disconnect logic and instead updates the output in-place before returning.

How Has This Been Tested?

Verified regular output still works fine. Will need more testing.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)
  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@WizardCM WizardCM added Enhancement Improvement to existing functionality Code Cleanup Non-breaking change which makes code smaller or more readable labels Mar 5, 2025
@exeldro
Copy link
Contributor

exeldro commented Mar 5, 2025

Documentation change is missing

@dsaedtler dsaedtler force-pushed the rodney/configurable-reconnect-on-error branch from 4b69871 to 6f5a581 Compare March 5, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code Cleanup Non-breaking change which makes code smaller or more readable Enhancement Improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants