]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
buffer was too small on cepstral damn it
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 27 May 2006 18:39:20 +0000 (18:39 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 27 May 2006 18:39:20 +0000 (18:39 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1516 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/asr_tts/mod_cepstral/mod_cepstral.c
src/switch_core.c
src/switch_rtp.c

index 0318df4a58c460839f2d3d77d572a0ac408c1681..e8aaace23602a51ce11c61fd923377c8532dd0e1 100644 (file)
@@ -67,6 +67,7 @@ static swift_result_t write_audio(swift_event *event, swift_event_t type, void *
        /* Only proceed when we have success */
     if (!SWIFT_FAILED((rv = swift_event_get_audio(event, &buf, &len)))) {
                switch_mutex_lock(cepstral->audio_lock);
+
                if (switch_buffer_write(cepstral->audio_buffer, buf, len) <= 0) {
                        rv = SWIFT_UNKNOWN_ERROR;
                }
@@ -91,7 +92,7 @@ static switch_status_t cepstral_speech_open(switch_speech_handle_t *sh, char *vo
                        return SWITCH_STATUS_MEMERR;
                }
 
-               if (switch_buffer_create(sh->memory_pool, &cepstral->audio_buffer, SWITCH_RECCOMMENDED_BUFFER_SIZE) != SWITCH_STATUS_SUCCESS) {
+               if (switch_buffer_create(sh->memory_pool, &cepstral->audio_buffer, 1024 * 256) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Write Buffer Failed!\n");
                        return SWITCH_STATUS_MEMERR;
                }
@@ -168,7 +169,6 @@ static switch_status_t cepstral_speech_feed_tts(switch_speech_handle_t *sh, char
        cepstral = sh->private_info;
        assert(cepstral != NULL);
 
-
        swift_port_speak_text(cepstral->port, text, 0, NULL, &cepstral->tts_stream, NULL); 
        //swift_port_speak_text(cepstral->port, text, 0, NULL, NULL, NULL); 
 
@@ -201,8 +201,6 @@ static switch_status_t cepstral_speech_read_tts(switch_speech_handle_t *sh,
 
                used = switch_buffer_inuse(cepstral->audio_buffer);
 
-
-               
                if (!used && cepstral->done_gen) {
                        break;
                }
index 1f278146e83f42292a2171e14143306aa81fb8a3..08287391ffaea7e5210b2321233f325c0ddde8b3 100644 (file)
@@ -1449,7 +1449,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_kill_channel(switch_
        switch_io_event_hook_kill_channel_t *ptr;
        switch_status_t status = SWITCH_STATUS_FALSE;
        
-       switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_NOTICE, "Kill %s [%d]\n", switch_channel_get_name(session->channel), sig);
+       switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_INFO, "Kill %s [%d]\n", switch_channel_get_name(session->channel), sig);
 
        if (session->endpoint_interface->io_routines->kill_channel) {
                if ((status = session->endpoint_interface->io_routines->kill_channel(session, sig)) == SWITCH_STATUS_SUCCESS) {
@@ -1717,7 +1717,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_new_memory_pool(switch_memory_pool_t
 
        assert(runtime.memory_pool != NULL);
 
-       if ((apr_pool_create(pool, runtime.memory_pool)) != SWITCH_STATUS_SUCCESS) {
+       if ((apr_pool_create(pool, NULL)) != SWITCH_STATUS_SUCCESS) {
                *pool = NULL;
                return SWITCH_STATUS_MEMERR;
        }
index 5a46d68865e0221f069171f5b1b6e8a0195fe311..a9661a5b7638bce95c9b89730fee3fea4a53aad1 100644 (file)
@@ -696,7 +696,6 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
        for(;;) {
                bytes = sizeof(rtp_msg_t);      
                status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes);
-
                
                if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) {
                        switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_BREAK);