mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-25 04:01:55 +00:00
FS-9002 #resolve [rtp timeout code is parsed on video but its designed for audio]
This commit is contained in:
parent
94d2018991
commit
ad5e6aff1e
@ -2215,33 +2215,35 @@ SWITCH_DECLARE(switch_status_t) switch_core_media_read_frame(switch_core_session
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((val = switch_channel_get_variable(session->channel, "rtp_timeout_sec"))) {
|
if (type == SWITCH_MEDIA_TYPE_AUDIO && engine->read_impl.samples_per_second) {
|
||||||
int v = atoi(val);
|
if ((val = switch_channel_get_variable(session->channel, "rtp_timeout_sec"))) {
|
||||||
if (v >= 0) {
|
int v = atoi(val);
|
||||||
rtp_timeout_sec = v;
|
if (v >= 0) {
|
||||||
|
rtp_timeout_sec = v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ((val = switch_channel_get_variable(session->channel, "rtp_hold_timeout_sec"))) {
|
if ((val = switch_channel_get_variable(session->channel, "rtp_hold_timeout_sec"))) {
|
||||||
int v = atoi(val);
|
int v = atoi(val);
|
||||||
if (v >= 0) {
|
if (v >= 0) {
|
||||||
rtp_hold_timeout_sec = v;
|
rtp_hold_timeout_sec = v;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (rtp_timeout_sec) {
|
if (rtp_timeout_sec) {
|
||||||
engine->max_missed_packets = (engine->read_impl.samples_per_second * rtp_timeout_sec) /
|
engine->max_missed_packets = (engine->read_impl.samples_per_second * rtp_timeout_sec) /
|
||||||
engine->read_impl.samples_per_packet;
|
engine->read_impl.samples_per_packet;
|
||||||
|
|
||||||
switch_rtp_set_max_missed_packets(engine->rtp_session, engine->max_missed_packets);
|
switch_rtp_set_max_missed_packets(engine->rtp_session, engine->max_missed_packets);
|
||||||
if (!rtp_hold_timeout_sec) {
|
if (!rtp_hold_timeout_sec) {
|
||||||
rtp_hold_timeout_sec = rtp_timeout_sec * 10;
|
rtp_hold_timeout_sec = rtp_timeout_sec * 10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (rtp_hold_timeout_sec) {
|
if (rtp_hold_timeout_sec) {
|
||||||
engine->max_missed_hold_packets = (engine->read_impl.samples_per_second * rtp_hold_timeout_sec) /
|
engine->max_missed_hold_packets = (engine->read_impl.samples_per_second * rtp_hold_timeout_sec) /
|
||||||
engine->read_impl.samples_per_packet;
|
engine->read_impl.samples_per_packet;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user