[Freeswitch-svn] [commit] r5990 - in freeswitch/trunk/src: . mod/applications/mod_conference
Freeswitch SVN
anthm at freeswitch.org
Fri Oct 19 01:09:18 EDT 2007
Author: anthm
Date: Fri Oct 19 01:09:18 2007
New Revision: 5990
Modified:
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
freeswitch/trunk/src/switch_core_io.c
Log:
you probably think i am joking but the g722 rfc ppl need to be punished
Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c (original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c Fri Oct 19 01:09:18 2007
@@ -243,6 +243,7 @@
switch_mutex_t *flag_mutex;
switch_mutex_t *audio_in_mutex;
switch_mutex_t *audio_out_mutex;
+ switch_codec_t *orig_read_codec;
switch_codec_t read_codec;
switch_codec_t write_codec;
char *rec_path;
@@ -1511,7 +1512,7 @@
uint32_t interval = read_codec->implementation->microseconds_per_frame / 1000;
uint32_t csamples = switch_bytes_per_frame(member->conference->rate, member->conference->interval);
uint32_t samples = switch_bytes_per_frame(member->conference->rate, interval);
- uint32_t tsamples = switch_bytes_per_frame(read_codec->implementation->samples_per_second, interval);
+ uint32_t tsamples;/* = switch_bytes_per_frame(read_codec->implementation->samples_per_second, interval);*/
uint32_t low_count = 0, bytes = samples * 2;
call_list_t *call_list = NULL, *cp = NULL;
@@ -1520,6 +1521,9 @@
assert(channel != NULL);
assert(member->conference != NULL);
+
+ tsamples = member->orig_read_codec->implementation->samples_per_frame;
+
if (switch_core_timer_init(&timer, member->conference->timer_name, interval,
//member->conference->interval,
tsamples, NULL) == SWITCH_STATUS_SUCCESS) {
@@ -4198,6 +4202,7 @@
/* Save the original read codec. */
read_codec = switch_core_session_get_read_codec(session);
+ member.orig_read_codec = read_codec;
member.native_rate = read_codec->implementation->samples_per_second;
member.pool = switch_core_session_get_pool(session);
@@ -4205,15 +4210,15 @@
if (switch_core_codec_init(&member.read_codec,
"L16",
NULL,
- read_codec->implementation->samples_per_second,
+ read_codec->implementation->actual_samples_per_second,
read_codec->implementation->microseconds_per_frame / 1000,
1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, member.pool) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
"Raw Codec Activation Success L16@%uhz 1 channel %dms\n",
- read_codec->implementation->samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
+ read_codec->implementation->actual_samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed L16@%uhz 1 channel %dms\n",
- read_codec->implementation->samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
+ read_codec->implementation->actual_samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
flags = 0;
goto done;
}
@@ -4250,10 +4255,10 @@
1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, member.pool) == SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
"Raw Codec Activation Success L16@%uhz 1 channel %dms\n",
- read_codec->implementation->samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
+ conference->rate, read_codec->implementation->microseconds_per_frame / 1000);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Raw Codec Activation Failed L16@%uhz 1 channel %dms\n",
- read_codec->implementation->samples_per_second, read_codec->implementation->microseconds_per_frame / 1000);
+ conference->rate, read_codec->implementation->microseconds_per_frame / 1000);
flags = 0;
goto codec_done2;
}
Modified: freeswitch/trunk/src/switch_core_io.c
==============================================================================
--- freeswitch/trunk/src/switch_core_io.c (original)
+++ freeswitch/trunk/src/switch_core_io.c Fri Oct 19 01:09:18 2007
@@ -149,7 +149,7 @@
goto done;
}
- if ((*frame)->codec->implementation->samples_per_second != session->write_codec->implementation->samples_per_second) {
+ if ((*frame)->codec->implementation->actual_samples_per_second != session->write_codec->implementation->actual_samples_per_second) {
do_resample = 1;
}
@@ -431,7 +431,7 @@
need_codec = 1;
}
- if (frame->codec->implementation->samples_per_second != session->read_codec->implementation->samples_per_second) {
+ if (frame->codec->implementation->actual_samples_per_second != session->read_codec->implementation->actual_samples_per_second) {
need_codec = 1;
do_resample = 1;
}
More information about the Freeswitch-svn
mailing list