mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
adjustment
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10876 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -58,6 +58,26 @@ SWITCH_DECLARE(void) switch_core_session_unset_read_codec(switch_core_session_t
|
||||
switch_mutex_unlock(session->codec_read_mutex);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_session_lock_codec_write(switch_core_session_t *session)
|
||||
{
|
||||
switch_mutex_lock(session->codec_write_mutex);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_session_unlock_codec_write(switch_core_session_t *session)
|
||||
{
|
||||
switch_mutex_unlock(session->codec_write_mutex);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_session_lock_codec_read(switch_core_session_t *session)
|
||||
{
|
||||
switch_mutex_lock(session->codec_read_mutex);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_session_unlock_codec_read(switch_core_session_t *session)
|
||||
{
|
||||
switch_mutex_unlock(session->codec_read_mutex);
|
||||
}
|
||||
|
||||
SWITCH_DECLARE(void) switch_core_session_unset_write_codec(switch_core_session_t *session)
|
||||
{
|
||||
switch_mutex_t *mutex = NULL;
|
||||
@@ -550,7 +570,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
|
||||
{
|
||||
switch_mutex_t *mutex;
|
||||
switch_memory_pool_t *pool;
|
||||
|
||||
int free_pool = 0;
|
||||
|
||||
switch_assert(codec != NULL);
|
||||
|
||||
if (!codec->implementation) {
|
||||
@@ -558,6 +579,10 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
|
||||
return SWITCH_STATUS_NOT_INITALIZED;
|
||||
}
|
||||
|
||||
if (switch_test_flag(codec, SWITCH_CODEC_FLAG_FREE_POOL)) {
|
||||
free_pool = 1;
|
||||
}
|
||||
|
||||
pool = codec->memory_pool;
|
||||
mutex = codec->mutex;
|
||||
|
||||
@@ -571,7 +596,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_codec_destroy(switch_codec_t *codec)
|
||||
|
||||
if (mutex) switch_mutex_unlock(mutex);
|
||||
|
||||
if (switch_test_flag(codec, SWITCH_CODEC_FLAG_FREE_POOL)) {
|
||||
if (free_pool) {
|
||||
switch_core_destroy_memory_pool(&pool);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user