On Windows, shutdown() will not interrupt a blocking connect() call, so
happy_eyeballs_destroy could block until the remaining candidates timed
out. As happy_eyeballs_destroy is called in the RTMP connect path, this
would stall the RTMP connection and cause the winning candidate's socket
to be disconnected due to a timeout.
The code currently assumes that the array does not change during
execution, this assumption is violated when the darray resizes causing
previous pointers to point to invalid memory and cause undefined
behavior and crashes.
This may need refactoring in the future, this commit simply fixes the
issue for now.
By not performing an unref on sw_frame before using it again, a memory
"leak" was being created if the frame had side data. This removes a
previously-added check that optionally unrefs sw_frame, and just does
it every tick.
Co-authored-by: pkviet <pkv@obsproject.com>