]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6891 FS-7002 FS-7059 FS-7072 FS-7073 FS-7076 #close #comment All of these bugs...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 12 Dec 2014 02:57:55 +0000 (20:57 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 12 Dec 2014 02:57:55 +0000 (20:57 -0600)
src/include/private/switch_core_pvt.h
src/switch_core_io.c
src/switch_ivr_async.c

index e64541b309ac22b098f0326d2865319f291defc0..d7933b4880151812631abaf7cac30c2bf4959c77 100644 (file)
@@ -179,9 +179,6 @@ struct switch_core_session {
 
        switch_media_handle_t *media_handle;
        uint32_t decoder_errors;
-    switch_time_t last_read_time;
-       switch_time_t last_write_time;
-
 };
 
 struct switch_media_bug {
index 8a1dd97120fed1c69ab49a7d752118cfc688ccf2..cb056adb73b406b9ce3d0a06d2628f280896ec40 100644 (file)
@@ -762,26 +762,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
                        switch_media_bug_t *bp;
                        switch_bool_t ok = SWITCH_TRUE;
                        int prune = 0;
-                       switch_time_t now = switch_micro_time_now();
-                       switch_time_t diff = 0;
-                       switch_size_t len = session->read_impl.decoded_bytes_per_packet;
-                       unsigned char fill_data[SWITCH_RECOMMENDED_BUFFER_SIZE] = {0};
-
                        switch_thread_rwlock_rdlock(session->bug_rwlock);
 
-                       if (session->last_read_time && session->last_read_time < now) {
-                               diff = ((now - session->last_read_time) + 3000 ) / session->read_impl.microseconds_per_packet;
-                               
-                               if (diff > 1) {
-                                       memset(fill_data, 255, len);
-                               }
-                       }
-                       
-                       session->last_read_time = switch_micro_time_now();
-
                        for (bp = session->bugs; bp; bp = bp->next) {
                                ok = SWITCH_TRUE;
-                               
+
                                if (switch_channel_test_flag(session->channel, CF_PAUSE_BUGS) && !switch_core_media_bug_test_flag(bp, SMBF_NO_PAUSE)) {
                                        continue;
                                }
@@ -801,17 +786,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_read_frame(switch_core_sessi
 
                                if (ok && bp->ready && switch_test_flag(bp, SMBF_READ_STREAM)) {
                                        switch_mutex_lock(bp->read_mutex);
-
-                                       if (diff > 1) {
-                                               switch_time_t tdiff = diff;
-
-                                               while(tdiff > 1) {
-                                                       switch_buffer_write(bp->raw_read_buffer, fill_data, len);
-                                                       tdiff--;
-                                               }
-
-                                       }
-                                       
                                        if (bp->read_demux_frame) {
                                                uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
                                                int bytes = read_frame->datalen / 2;
@@ -1371,23 +1345,8 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
        if (session->bugs) {
                switch_media_bug_t *bp;
                int prune = 0;
-               switch_time_t now = switch_micro_time_now();
-               switch_time_t diff = 0;
-               switch_size_t len = session->read_impl.decoded_bytes_per_packet;
-               unsigned char fill_data[SWITCH_RECOMMENDED_BUFFER_SIZE] = {0};
-               
-               switch_thread_rwlock_rdlock(session->bug_rwlock);
-
-               if (session->last_write_time && session->last_write_time < now) {
-                       diff = ((now - session->last_write_time) + 3000 ) / session->read_impl.microseconds_per_packet;
-                               
-                       if (diff > 1) {
-                               memset(fill_data, 255, len);
-                       }
-               }
-
-               session->last_write_time = switch_micro_time_now();
 
+               switch_thread_rwlock_rdlock(session->bug_rwlock);
                for (bp = session->bugs; bp; bp = bp->next) {
                        switch_bool_t ok = SWITCH_TRUE;
 
@@ -1410,15 +1369,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
 
                        if (switch_test_flag(bp, SMBF_WRITE_STREAM)) {
                                switch_mutex_lock(bp->write_mutex);
-                               if (diff > 1) {
-                                       switch_time_t tdiff = diff;
-                                       
-                                       while(tdiff > 1) {
-                                               switch_buffer_write(bp->raw_read_buffer, fill_data, len);
-                                               tdiff--;
-                                       }
-                               }
-                               
                                switch_buffer_write(bp->raw_write_buffer, write_frame->data, write_frame->datalen);
                                switch_mutex_unlock(bp->write_mutex);
                                
index 3d3509b09125cab0f9adb4eae37b97abceff751a..25ec4d7285a5e9d1998a147312d556ec77fb3418 100644 (file)
@@ -1313,13 +1313,12 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s
                        uint8_t data[SWITCH_RECOMMENDED_BUFFER_SIZE];
                        switch_frame_t frame = { 0 };
                        switch_status_t status;
-                       int x = 0;
 
                        frame.data = data;
                        frame.buflen = SWITCH_RECOMMENDED_BUFFER_SIZE;
 
                        for (;;) {
-                               status = switch_core_media_bug_read(bug, &frame, x++ == 0);
+                               status = switch_core_media_bug_read(bug, &frame, SWITCH_FALSE);
 
                                if (status == SWITCH_STATUS_SUCCESS || status == SWITCH_STATUS_BREAK) {