git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3795 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2006-12-22 15:55:52 +00:00
1 parent 302a768c9f
commit 9bf1884d47
3 files changed
+21 -16

No files matched your search

+13 -11
View File
@@ -1280,17 +1280,19 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
}
if (tech_pvt->read_frame.datalen > 0) {
if (tech_pvt->read_codec.implementation->encoded_bytes_per_frame) {
bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame;
frames = (tech_pvt->read_frame.datalen / bytes);
} else {
frames = 1;
}
samples = frames * tech_pvt->read_codec.implementation->samples_per_frame;
ms = frames * tech_pvt->read_codec.implementation->microseconds_per_frame;
tech_pvt->timestamp_recv += (int32_t) samples;
tech_pvt->read_frame.samples = (int) samples;
tech_pvt->last_read = tech_pvt->read_frame.datalen;
if (!switch_test_flag((&tech_pvt->read_frame), SFF_CNG)) {
if (tech_pvt->read_codec.implementation->encoded_bytes_per_frame && bytes) {
bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame;
frames = (tech_pvt->read_frame.datalen / bytes);
} else {
frames = 1;
}
samples = frames * tech_pvt->read_codec.implementation->samples_per_frame;
ms = frames * tech_pvt->read_codec.implementation->microseconds_per_frame;
tech_pvt->timestamp_recv += (int32_t) samples;
tech_pvt->read_frame.samples = (int) samples;
tech_pvt->last_read = tech_pvt->read_frame.datalen;
}
break;
}