[Core] Add new switch_core_session_try_reset() API to fix a deadlock for the case when two threads want to set session codecs.

This commit is contained in:
Andrey Volk
2021-02-27 01:04:16 +03:00
parent c63f9524ee
commit c61d89a47f
3 changed files with 40 additions and 2 deletions
+8
View File
@@ -1359,6 +1359,14 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_set_video_write_impl(switch_
*/
SWITCH_DECLARE(void) switch_core_session_reset(_In_ switch_core_session_t *session, switch_bool_t flush_dtmf, switch_bool_t reset_read_codec);
/*!
\brief Reset the buffers and resampler on a session, fail if can not lock codec mutexes
\param session the session to reset
\param flush_dtmf flush all queued dtmf events too
\return SWITCH_STATUS_SUCCESS if the session was reset
*/
SWITCH_DECLARE(switch_status_t) switch_core_session_try_reset(switch_core_session_t* session, switch_bool_t flush_dtmf, switch_bool_t reset_read_codec);
/*!
\brief Write a frame to a session
\param session the session to write to