]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_portaudio: do not destroy codec and timers if there is a call in progress!
authorMoises Silva <moises.silva@gmail.com>
Sun, 20 Mar 2011 06:36:46 +0000 (02:36 -0400)
committerMoises Silva <moises.silva@gmail.com>
Sun, 20 Mar 2011 06:36:46 +0000 (02:36 -0400)
src/mod/endpoints/mod_portaudio/mod_portaudio.c

index e27d24b1900560a3255bfb8d605365bcd89735fe..291cc00c4a5a2bc7d9191129d320659780537250 100644 (file)
@@ -1245,17 +1245,19 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
 
 error:
        if (endpoint) {
-               if (endpoint->read_timer.interval) {
-                       switch_core_timer_destroy(&endpoint->read_timer);
-               }
-               if (endpoint->write_timer.interval) {
-                       switch_core_timer_destroy(&endpoint->write_timer);
-               }
-               if (endpoint->read_codec.codec_interface) {
-                       switch_core_codec_destroy(&endpoint->read_codec);
-               }
-               if (endpoint->write_codec.codec_interface) {
-                       switch_core_codec_destroy(&endpoint->write_codec);
+               if (!endpoint->master) {
+                       if (endpoint->read_timer.interval) {
+                               switch_core_timer_destroy(&endpoint->read_timer);
+                       }
+                       if (endpoint->write_timer.interval) {
+                               switch_core_timer_destroy(&endpoint->write_timer);
+                       }
+                       if (endpoint->read_codec.codec_interface) {
+                               switch_core_codec_destroy(&endpoint->read_codec);
+                       }
+                       if (endpoint->write_codec.codec_interface) {
+                               switch_core_codec_destroy(&endpoint->write_codec);
+                       }
                }
                switch_mutex_unlock(endpoint->mutex);
        }