]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4896 please try this
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 30 Nov 2012 19:54:15 +0000 (13:54 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 30 Nov 2012 19:54:47 +0000 (13:54 -0600)
src/switch_core_media_bug.c

index b0d9e8d4f94a923afe7dcbde765ce9acdca0acce..7beb04815551c3f034cc2d0577e29686bb274961 100644 (file)
@@ -183,18 +183,6 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
 
        bytes = read_impl.decoded_bytes_per_packet;
 
-#ifdef TESTINGONLY
-       if (0 && bug->session->recur_buffer_len) {
-               frame->datalen = bug->session->recur_buffer_len;
-               frame->samples = bug->session->recur_buffer_len / sizeof(int16_t);
-               frame->rate = read_impl.actual_samples_per_second;
-               frame->codec = NULL;
-               memcpy(frame->data, bug->session->recur_buffer, bug->session->recur_buffer_len);
-               return SWITCH_STATUS_SUCCESS;
-       }
-#endif
-
-
        if (frame->buflen < bytes) {
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(switch_core_media_bug_get_session(bug)), SWITCH_LOG_ERROR, "%s frame buffer too small!\n",
                                                  switch_channel_get_name(bug->session->channel));
@@ -232,15 +220,16 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
        }
 
        if (!bug->record_frame_size) {
-               if (do_read && do_write) {
-                       switch_size_t frame_size;
-                       switch_codec_implementation_t read_impl = { 0 };
-                       switch_codec_implementation_t other_read_impl = { 0 };
-                       switch_core_session_t *other_session;
-                       
-                       switch_core_session_get_read_impl(bug->session, &read_impl);
-                       frame_size = read_impl.decoded_bytes_per_packet;
+               switch_size_t frame_size;
+               switch_codec_implementation_t read_impl = { 0 };
+               //switch_codec_implementation_t other_read_impl = { 0 };
+               //switch_core_session_t *other_session;
                        
+               switch_core_session_get_read_impl(bug->session, &read_impl);
+               frame_size = read_impl.decoded_bytes_per_packet;
+               bug->record_frame_size = frame_size;
+#if 0
+               if (do_read && do_write) {                      
                        if (switch_core_session_get_partner(bug->session, &other_session) == SWITCH_STATUS_SUCCESS) {
                                switch_core_session_get_read_impl(other_session, &other_read_impl);
                                switch_core_session_rwunlock(other_session);
@@ -258,6 +247,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_bug_read(switch_media_bug_t *b
 
                        bug->record_frame_size = frame_size;
                }
+#endif
        }