Skip to content

Commit 14bc7bc

Browse files
committed
Threads: Keep alive when got RTP plaintext
1 parent e15737f commit 14bc7bc

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

trunk/src/app/srs_app_rtc_conn.cpp

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -205,37 +205,21 @@ srs_error_t SrsSecurityTransport::srtp_initialize()
205205

206206
srs_error_t SrsSecurityTransport::on_rtp_plaintext(char* plaintext, int size)
207207
{
208-
// We should keep alive here, because when tunnel is enabled, the connection die
209-
// for the SrsRtcServer::on_udp_packet might be skipped.
210-
session_->alive();
211-
212208
return session_->on_rtp_plaintext(plaintext, size);
213209
}
214210

215211
srs_error_t SrsSecurityTransport::on_rtcp_plaintext(char* plaintext, int size)
216212
{
217-
// We should keep alive here, because when tunnel is enabled, the connection die
218-
// for the SrsRtcServer::on_udp_packet might be skipped.
219-
session_->alive();
220-
221213
return session_->on_rtcp_plaintext(plaintext, size);
222214
}
223215

224216
srs_error_t SrsSecurityTransport::on_rtp_cipher(char* cipher, int size)
225217
{
226-
// We should keep alive here, because when tunnel is enabled, the connection die
227-
// for the SrsRtcServer::on_udp_packet might be skipped.
228-
session_->alive();
229-
230218
return session_->on_rtp_cipher(cipher, size);
231219
}
232220

233221
srs_error_t SrsSecurityTransport::on_rtcp_cipher(char* cipher, int size)
234222
{
235-
// We should keep alive here, because when tunnel is enabled, the connection die
236-
// for the SrsRtcServer::on_udp_packet might be skipped.
237-
session_->alive();
238-
239223
return session_->on_rtcp_cipher(cipher, size);
240224
}
241225

@@ -2245,6 +2229,9 @@ srs_error_t SrsRtcConnection::on_rtp_plaintext(char* plaintext, int nb_plaintext
22452229
{
22462230
srs_error_t err = srs_success;
22472231

2232+
// We should keep alive here, for tunnel is enabled.
2233+
alive();
2234+
22482235
SrsRtcPublishStream* publisher = NULL;
22492236
if ((err = find_publisher(plaintext, nb_plaintext, &publisher)) != srs_success) {
22502237
return srs_error_wrap(err, "find");

0 commit comments

Comments
 (0)