]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4115 possible workaround for sipura bug + recording
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 16 Apr 2012 16:14:14 +0000 (11:14 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 16 Apr 2012 16:14:22 +0000 (11:14 -0500)
src/switch_core_io.c
src/switch_core_media_bug.c

index 952b345e673b21a5d5f11772855cdd999ba83d9c..bfc8f1cd33d1acc7b7056e3acc5df8eb0e8d7f67 100644 (file)
@@ -1101,6 +1101,9 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_write_frame(switch_core_sess
                                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Write Buffer Failed!\n");
                                        goto error;
                                }
+
+                               /* Need to retrain the recording data */
+                               switch_core_media_bug_flush_all(session);
                        }
 
                        if (!(switch_buffer_write(session->raw_write_buffer, write_frame->data, write_frame->datalen))) {
index 0397aa666b713a56d78f7792f406da96dd0c2160..313552124f804498c1c4b795244907c801c57810 100644 (file)
@@ -126,6 +126,10 @@ SWITCH_DECLARE(void) switch_core_media_bug_flush(switch_media_bug_t *bug)
                switch_buffer_zero(bug->raw_write_buffer);
                switch_mutex_unlock(bug->write_mutex);
        }
+
+       bug->record_frame_size = 0;
+       bug->record_pre_buffer_count = 0;
+
 }
 
 SWITCH_DECLARE(void) switch_core_media_bug_inuse(switch_media_bug_t *bug, switch_size_t *readp, switch_size_t *writep)