]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
refactor resampling in mod_local_stream
authorAnthony Minessale <anthony.minessale@gmail.com>
Sun, 3 May 2009 03:15:42 +0000 (03:15 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sun, 3 May 2009 03:15:42 +0000 (03:15 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13222 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/formats/mod_local_stream/mod_local_stream.c

index 6b91a35b5caa4ce0d2fd3b1f618110667729328f..2820cdd502f64c51b90470c679e2ce48d377c7eb 100644 (file)
@@ -1248,11 +1248,11 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
                        } else {
                                switch_set_string(ref_to, msg->string_arg);
                        }
+                       switch_yield(10);
                        nua_refer(tech_pvt->nh, SIPTAG_REFER_TO_STR(ref_to), SIPTAG_REFERRED_BY_STR(tech_pvt->contact_url), TAG_END());
                        switch_mutex_unlock(tech_pvt->sofia_mutex);
                        sofia_wait_for_reply(tech_pvt, 9999, 300);
                        switch_mutex_lock(tech_pvt->sofia_mutex);
-                       
                        if ((var = switch_channel_get_variable(tech_pvt->channel, "sip_refer_reply"))) {
                                msg->string_reply = switch_core_session_strdup(session, var); 
                        } else {
index 9cd460310d01c6e6386b0e5cf6e0994590288533..2cc866145d8bf46551633a1a76e52a8608d61fd1 100644 (file)
@@ -184,7 +184,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
                        fname = path_buf;
                        fh.prebuf = source->prebuf;
                        fh.pre_buffer_datalen = source->prebuf;
-
+                       
                        if (switch_core_file_open(&fh,
                                                                          (char *) fname,
                                                                          source->channels, source->rate, SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT, NULL) != SWITCH_STATUS_SUCCESS) {
@@ -192,10 +192,7 @@ static void *SWITCH_THREAD_FUNC read_stream_thread(switch_thread_t *thread, void
                                switch_yield(1000000);
                                continue;
                        }
-
-                       source->rate = fh.samplerate;
-                       source->samples = switch_samples_per_packet(fh.native_rate, source->interval);
-
+                       
                        if (switch_core_timer_init(&timer, source->timer_name, source->interval, source->samples, source->pool) != SWITCH_STATUS_SUCCESS) {
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CONSOLE, "Can't start timer.\n");
                                switch_dir_close(source->dir_handle);