Author: anthm Date: Thu Apr 9 17:02:19 2009 New Revision: 12975 Log: try to fix possible null codec issue Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp Modified: freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp (original) +++ freeswitch/trunk/src/mod/endpoints/mod_opal/mod_opal.cpp Thu Apr 9 17:02:19 2009 @@ -1144,7 +1144,6 @@ m_switchCodec->implementation->samples_per_packet, switch_core_session_get_pool(m_fsSession)) != SWITCH_STATUS_SUCCESS) { switch_core_codec_destroy(m_switchCodec); - m_switchCodec = NULL; return false; } } else { @@ -1172,11 +1171,6 @@ if (!IsOpen()) return false; - /* forget these FS will properly destroy them for us */ - - m_switchTimer = NULL; - m_switchCodec = NULL; - return OpalMediaStream::Close(); } @@ -1261,6 +1255,10 @@ return SWITCH_STATUS_FALSE; } + if (!switch_core_codec_ready(m_switchCodec)) { + return SWITCH_STATUS_FALSE; + } + //switch_core_timer_step(&m_switchTimer); m_readFrame.buflen = m_readRTP.GetSize();