[Freeswitch-svn] [commit] r12047 - freeswitch/trunk/src

FreeSWITCH SVN anthm at freeswitch.org
Mon Feb 16 06:15:38 PST 2009


Author: anthm
Date: Mon Feb 16 08:15:38 2009
New Revision: 12047

Log:
FSCORE-299

Modified:
   freeswitch/trunk/src/switch_core_media_bug.c

Modified: freeswitch/trunk/src/switch_core_media_bug.c
==============================================================================
--- freeswitch/trunk/src/switch_core_media_bug.c	(original)
+++ freeswitch/trunk/src/switch_core_media_bug.c	Mon Feb 16 08:15:38 2009
@@ -212,6 +212,18 @@
 {
 	switch_media_bug_t *bug;	//, *bp;
 	switch_size_t bytes;
+	switch_codec_implementation_t read_impl = {0};
+	switch_codec_implementation_t write_impl = {0};
+	
+
+	if (!switch_channel_media_ready(session->channel)) {
+		if (switch_channel_pre_answer(session->channel) != SWITCH_STATUS_SUCCESS) {
+			return SWITCH_STATUS_FALSE;
+		}
+	}
+
+	switch_core_session_get_read_impl(session, &read_impl);
+	switch_core_session_get_write_impl(session, &write_impl);
 
 	*new_bug = NULL;
 
@@ -251,7 +263,7 @@
 	bug->flags = flags;
 
 	bug->stop_time = stop_time;
-	bytes = session->read_codec->implementation->decoded_bytes_per_packet;
+	bytes = read_impl.decoded_bytes_per_packet;
 
 	if (!bug->flags) {
 		bug->flags = (SMBF_READ_STREAM | SMBF_WRITE_STREAM);
@@ -262,7 +274,7 @@
 		switch_mutex_init(&bug->read_mutex, SWITCH_MUTEX_NESTED, session->pool);
 	}
 
-	bytes = session->write_codec->implementation->decoded_bytes_per_packet;
+	bytes = write_impl.decoded_bytes_per_packet;
 
 	if (switch_test_flag(bug, SMBF_WRITE_STREAM)) {
 		switch_buffer_create_dynamic(&bug->raw_write_buffer, bytes * SWITCH_BUFFER_BLOCK_FRAMES, bytes * SWITCH_BUFFER_START_FRAMES, MAX_BUG_BUFFER);



More information about the Freeswitch-svn mailing list