OBS Studio - Free and open source software for live streaming and screen recording
obs-outputs: Fix librtmp mbedtls thread safety
Per mbedtls documentation, "If you share a context between threads, you need to call these functions only from the main thread, at the beginning and end of the context's lifetime.". OBS violated this since librtmp uses a global context and it was allocated and freed in different threads such as the auto config test. This commit attaches the mbedtls context to an RTMP structure so there is no more global state. It also fixes a rare double-free crash that could occur if RTMP_TLS_Free was called twice (this happened in rare situations such as the auto config running followed by a mode change from Advanced to Simple).
R
Richard Stanway committed
2b131d212fc0e5a6cd095b502072ddbedc54ab52
Parent: 44dc06e