mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-17 01:02:12 +00:00
refactor
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3795 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
302a768c9f
commit
9bf1884d47
@ -1280,7 +1280,8 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tech_pvt->read_frame.datalen > 0) {
|
if (tech_pvt->read_frame.datalen > 0) {
|
||||||
if (tech_pvt->read_codec.implementation->encoded_bytes_per_frame) {
|
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;
|
bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame;
|
||||||
frames = (tech_pvt->read_frame.datalen / bytes);
|
frames = (tech_pvt->read_frame.datalen / bytes);
|
||||||
} else {
|
} else {
|
||||||
@ -1291,6 +1292,7 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
|||||||
tech_pvt->timestamp_recv += (int32_t) samples;
|
tech_pvt->timestamp_recv += (int32_t) samples;
|
||||||
tech_pvt->read_frame.samples = (int) samples;
|
tech_pvt->read_frame.samples = (int) samples;
|
||||||
tech_pvt->last_read = tech_pvt->read_frame.datalen;
|
tech_pvt->last_read = tech_pvt->read_frame.datalen;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1614,9 +1614,12 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
|
|||||||
size_t bytes = 0;
|
size_t bytes = 0;
|
||||||
int frames = 0;
|
int frames = 0;
|
||||||
//tech_pvt->last_read = switch_time_now();
|
//tech_pvt->last_read = switch_time_now();
|
||||||
bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame;
|
if (!switch_test_flag((&tech_pvt->read_frame), SFF_CNG)) {
|
||||||
|
if ((bytes = tech_pvt->read_codec.implementation->encoded_bytes_per_frame)) {
|
||||||
frames = (tech_pvt->read_frame.datalen / bytes);
|
frames = (tech_pvt->read_frame.datalen / bytes);
|
||||||
tech_pvt->read_frame.samples = (int) (frames * tech_pvt->read_codec.implementation->samples_per_frame);
|
tech_pvt->read_frame.samples = (int) (frames * tech_pvt->read_codec.implementation->samples_per_frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -782,7 +782,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
|||||||
*flags |= SFF_CNG;
|
*flags |= SFF_CNG;
|
||||||
/* Return a CNG frame */
|
/* Return a CNG frame */
|
||||||
*payload_type = SWITCH_RTP_CNG_PAYLOAD;
|
*payload_type = SWITCH_RTP_CNG_PAYLOAD;
|
||||||
return SWITCH_RTP_CNG_PAYLOAD;
|
return SWITCH_RTP_CNG_PAYLOAD + rtp_header_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) {
|
if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) {
|
||||||
@ -857,7 +857,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
|||||||
*flags |= SFF_CNG;
|
*flags |= SFF_CNG;
|
||||||
/* Return a CNG frame */
|
/* Return a CNG frame */
|
||||||
*payload_type = SWITCH_RTP_CNG_PAYLOAD;
|
*payload_type = SWITCH_RTP_CNG_PAYLOAD;
|
||||||
return SWITCH_RTP_CNG_PAYLOAD;
|
return SWITCH_RTP_CNG_PAYLOAD + rtp_header_len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user