This is an attempt to fix crash on RTMP output creation.
Motivation and Context
During its construction RTMP stream uses data from a currently active codec.
Because OBS_service::updateVideoStreamingEncoder recreates encoder every time someone wants to update it in simple mode, there is a possible gap when there is no encoder attached to output. So the goal of the fix is to destroy previous encoder only after the new one was created and avoid that gap and crash on null pointer.
I also updated other places in that component which might suffer from the same issue.
How Has This Been Tested?
Manually, Windows only
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
[ x ] The code has been tested.
[ x ] All commit messages are properly formatted and commits squashed where appropriate.
[ x ] I have included updates to all appropriate documentation.
Description
This is an attempt to fix crash on RTMP output creation.
Motivation and Context
During its construction RTMP stream uses data from a currently active codec. Because
OBS_service::updateVideoStreamingEncoder
recreates encoder every time someone wants to update it in simple mode, there is a possible gap when there is no encoder attached to output. So the goal of the fix is to destroy previous encoder only after the new one was created and avoid that gap and crash on null pointer.I also updated other places in that component which might suffer from the same issue.
How Has This Been Tested?
Manually, Windows only
Types of changes
Checklist: