mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
revert FS-9368
This commit is contained in:
+9
-12
@@ -4061,7 +4061,7 @@ SWITCH_DECLARE(switch_jb_t *) switch_rtp_get_jitter_buffer(switch_rtp_t *rtp_ses
|
||||
SWITCH_DECLARE(switch_status_t) switch_rtp_pause_jitter_buffer(switch_rtp_t *rtp_session, switch_bool_t pause)
|
||||
{
|
||||
|
||||
if (!switch_rtp_ready(rtp_session) || (!rtp_session->jb && !rtp_session->vb)) {
|
||||
if (!switch_rtp_ready(rtp_session) || !rtp_session->jb) {
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
@@ -4070,11 +4070,7 @@ SWITCH_DECLARE(switch_status_t) switch_rtp_pause_jitter_buffer(switch_rtp_t *rtp
|
||||
}
|
||||
|
||||
if (rtp_session->pause_jb && !pause) {
|
||||
if (rtp_session->vb) {
|
||||
switch_jb_reset(rtp_session->vb);
|
||||
} else {
|
||||
switch_jb_reset(rtp_session->jb);
|
||||
}
|
||||
switch_jb_reset(rtp_session->jb);
|
||||
}
|
||||
|
||||
rtp_session->pause_jb = pause ? 1 : 0;
|
||||
@@ -5650,7 +5646,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
|
||||
if (rtp_session->has_rtp && *bytes) {
|
||||
uint32_t read_ssrc = ntohl(rtp_session->last_rtp_hdr.ssrc);
|
||||
|
||||
if (rtp_session->vb && jb_valid(rtp_session) && !rtp_session->pause_jb) {
|
||||
if (rtp_session->vb && jb_valid(rtp_session)) {
|
||||
status = switch_jb_put_packet(rtp_session->vb, (switch_rtp_packet_t *) &rtp_session->recv_msg, *bytes);
|
||||
|
||||
if (status == SWITCH_STATUS_TOO_LATE) {
|
||||
@@ -5745,7 +5741,7 @@ static switch_status_t read_rtp_packet(switch_rtp_t *rtp_session, switch_size_t
|
||||
}
|
||||
}
|
||||
|
||||
if (rtp_session->vb && jb_valid(rtp_session) && !rtp_session->pause_jb) {
|
||||
if (rtp_session->vb && jb_valid(rtp_session)) {
|
||||
switch_status_t vstatus = switch_jb_get_packet(rtp_session->vb, (switch_rtp_packet_t *) &rtp_session->recv_msg, bytes);
|
||||
status = vstatus;
|
||||
|
||||
@@ -6335,7 +6331,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||
pt = 200000;
|
||||
}
|
||||
|
||||
if (rtp_session->vb && !rtp_session->pause_jb) {
|
||||
if (rtp_session->vb) {
|
||||
if (switch_jb_poll(rtp_session->vb)) {
|
||||
pt = 0;
|
||||
}
|
||||
@@ -6344,12 +6340,12 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||
if ((io_flags & SWITCH_IO_FLAG_NOBLOCK)) {
|
||||
pt = 0;
|
||||
}
|
||||
|
||||
|
||||
poll_status = switch_poll(rtp_session->read_pollfd, 1, &fdr, pt);
|
||||
|
||||
|
||||
//if (rtp_session->flags[SWITCH_RTP_FLAG_VIDEO]) {
|
||||
// switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "WTF Poll %d %d\n", pt, poll_status);
|
||||
// switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(rtp_session->session), SWITCH_LOG_WARNING, "WTF Poll %d\n", poll_status);
|
||||
//}
|
||||
|
||||
if (!rtp_session->flags[SWITCH_RTP_FLAG_VIDEO] && rtp_session->dtmf_data.out_digit_dur > 0) {
|
||||
@@ -6366,7 +6362,7 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
||||
}
|
||||
|
||||
|
||||
if (poll_status == SWITCH_STATUS_SUCCESS || (rtp_session->vb && !rtp_session->pause_jb && switch_jb_poll(rtp_session->vb))) {
|
||||
if (poll_status == SWITCH_STATUS_SUCCESS || (rtp_session->vb && switch_jb_poll(rtp_session->vb))) {
|
||||
|
||||
got_rtp_poll = 1;
|
||||
|
||||
@@ -7301,6 +7297,7 @@ static int rtp_common_write(switch_rtp_t *rtp_session,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_GEN_TS_DELTA) || switch_rtp_test_flag(rtp_session, SWITCH_RTP_FLAG_VIDEO)) {
|
||||
/* Normalize the timestamps to our own base by generating a made up starting point then adding the measured deltas to that base
|
||||
so if the timestamps and ssrc of the source change, it will not break the other end's jitter bufffer / decoder etc *cough* CHROME *cough*
|
||||
|
||||
Reference in New Issue
Block a user