UI: Implement multitrack output restart if stream key has become invalid #11452
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a special handling for the invalid key case where a previously successful connection with the multitrack output will restart the stream from scratch in order to re-run to multitrack configuration and fetch a new signed stream key.
Motivation and Context
Twitch EB uses a signed stream key that is valid for 48 hours. Since the time limit for a stream on Twitch is also 48 hours that means that when a user will get disconnected upon hitting the hour limit they will no longer be able to reconnect.
In order to allow users to run 24/7 streams with EB we therefore need to manually restart the stream once it has stopped due to an invalid stream key.
This PR accomplishes that by invoking
StartStreaming()
again once the previous output session has been stopped with an "invalid key" error code (provided the previous output session was successful, and the user has not manually stopped the stream).This change also removes the now-unnecessary deactivate handlers, they previously existed to work around encoder reference counting issues which have now been fixed upstream.
The submission of this PR was delayed as Twitch had a server-side issue that needed to be fixed first, that fix should now be live on all production servers.
How Has This Been Tested?
*Tested with an earlier revision of the PR based on Twitch fork.
Types of changes
Checklist: