]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODAPP-398
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 17 Feb 2010 21:57:45 +0000 (21:57 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 17 Feb 2010 21:57:45 +0000 (21:57 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16681 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_conference/mod_conference.c
src/switch_core_io.c

index 875c4415be85dca6ccc8fd6bde4bb39ee644583a..e108dc89ecb50ff2863598a36b5d49f056cdad7a 100644 (file)
@@ -1046,7 +1046,7 @@ static void *SWITCH_THREAD_FUNC conference_thread_run(switch_thread_t *thread, v
                }
 
                /* Start recording if there's more than one participant. */
-               if (ready > 1 && conference->auto_record && !conference->is_recording) {
+               if (conference->auto_record && !conference->is_recording && conference->count > 1) {
                        conference->is_recording = 1;
                        imember = conference->members;
                        if (imember) {
index 4d7e0d52cfd9a1a9de4d9de21a6400b83bf39b2d..24e7bdb40042c028f04fb9c1a23cf5844bede00f 100644 (file)
@@ -105,11 +105,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
        switch_io_event_hook_read_frame_t *ptr;
        switch_status_t status = SWITCH_STATUS_FALSE;
        int need_codec, perfect, do_bugs = 0, do_resample = 0, is_cng = 0;
-       unsigned int flag = 0;
+       unsigned int flag = 0, sanity = 5000;
        switch_codec_implementation_t codec_impl;
-
+       
        switch_assert(session != NULL);
 
+       while(!switch_channel_media_ack(session->channel) || !switch_channel_test_flag(session->channel, CF_MEDIA_SET)) {
+               if (!--sanity) break;
+               switch_cond_next();
+       }
+
        if (!(session->read_codec && session->read_codec->implementation && switch_core_codec_ready(session->read_codec))) {
                if (switch_channel_test_flag(session->channel, CF_PROXY_MODE) || switch_channel_get_state(session->channel) == CS_HIBERNATE) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_CRIT, "%s reading on a session with no media!\n",
@@ -567,6 +572,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
        switch_status_t status = SWITCH_STATUS_FALSE;
        switch_frame_t *enc_frame = NULL, *write_frame = frame;
        unsigned int flag = 0, need_codec = 0, perfect = 0, do_bugs = 0, do_write = 0, do_resample = 0, ptime_mismatch = 0, pass_cng = 0, resample = 0;
+       unsigned int sanity = 5000;
        int did_write_resample = 0;
 
        switch_assert(session != NULL);
@@ -583,6 +589,12 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                return SWITCH_STATUS_SUCCESS;
        }
 
+
+       while(!switch_channel_media_ack(session->channel) || !switch_channel_test_flag(session->channel, CF_MEDIA_SET)) {
+               if (!--sanity) break;
+               switch_cond_next();
+       }
+
        if (!(session->write_codec && switch_core_codec_ready(session->write_codec)) && !pass_cng) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "%s has no write codec.\n", switch_channel_get_name(session->channel));
                return SWITCH_STATUS_FALSE;