mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-23 12:42:02 +00:00
FSCORE-349 add flag to denote if a codec is init or not
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12961 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -113,11 +113,11 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses
|
||||
interval = codec->implementation->microseconds_per_packet / 1000;
|
||||
}
|
||||
|
||||
if (tech_pvt->read_codec.implementation) {
|
||||
if (switch_core_codec_ready(&tech_pvt->read_codec)) {
|
||||
switch_core_codec_destroy(&tech_pvt->read_codec);
|
||||
}
|
||||
|
||||
if (tech_pvt->write_codec.implementation) {
|
||||
if (switch_core_codec_ready(&tech_pvt->write_codec)) {
|
||||
switch_core_codec_destroy(&tech_pvt->write_codec);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ static switch_status_t tech_init(private_t *tech_pvt, switch_core_session_t *ses
|
||||
NULL,
|
||||
switch_core_session_get_pool(session));
|
||||
|
||||
if (status != SWITCH_STATUS_SUCCESS || !tech_pvt->read_codec.implementation) {
|
||||
if (status != SWITCH_STATUS_SUCCESS || !tech_pvt->read_codec.implementation || !switch_core_codec_ready(&tech_pvt->read_codec)) {
|
||||
goto end;
|
||||
}
|
||||
|
||||
@@ -373,11 +373,11 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
|
||||
|
||||
switch_core_timer_destroy(&tech_pvt->timer);
|
||||
|
||||
if (tech_pvt->read_codec.implementation) {
|
||||
if (switch_core_codec_ready(&tech_pvt->read_codec)) {
|
||||
switch_core_codec_destroy(&tech_pvt->read_codec);
|
||||
}
|
||||
|
||||
if (tech_pvt->write_codec.implementation) {
|
||||
if (switch_core_codec_ready(&tech_pvt->write_codec)) {
|
||||
switch_core_codec_destroy(&tech_pvt->write_codec);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user