Skip to content

Commit

Permalink
Threads: Keep alive when got RTP plaintext
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Apr 26, 2021
1 parent e15737f commit 14bc7bc
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions trunk/src/app/srs_app_rtc_conn.cpp
Expand Up @@ -205,37 +205,21 @@ srs_error_t SrsSecurityTransport::srtp_initialize()

srs_error_t SrsSecurityTransport::on_rtp_plaintext(char* plaintext, int size)
{
// We should keep alive here, because when tunnel is enabled, the connection die
// for the SrsRtcServer::on_udp_packet might be skipped.
session_->alive();

return session_->on_rtp_plaintext(plaintext, size);
}

srs_error_t SrsSecurityTransport::on_rtcp_plaintext(char* plaintext, int size)
{
// We should keep alive here, because when tunnel is enabled, the connection die
// for the SrsRtcServer::on_udp_packet might be skipped.
session_->alive();

return session_->on_rtcp_plaintext(plaintext, size);
}

srs_error_t SrsSecurityTransport::on_rtp_cipher(char* cipher, int size)
{
// We should keep alive here, because when tunnel is enabled, the connection die
// for the SrsRtcServer::on_udp_packet might be skipped.
session_->alive();

return session_->on_rtp_cipher(cipher, size);
}

srs_error_t SrsSecurityTransport::on_rtcp_cipher(char* cipher, int size)
{
// We should keep alive here, because when tunnel is enabled, the connection die
// for the SrsRtcServer::on_udp_packet might be skipped.
session_->alive();

return session_->on_rtcp_cipher(cipher, size);
}

Expand Down Expand Up @@ -2245,6 +2229,9 @@ srs_error_t SrsRtcConnection::on_rtp_plaintext(char* plaintext, int nb_plaintext
{
srs_error_t err = srs_success;

// We should keep alive here, for tunnel is enabled.
alive();

SrsRtcPublishStream* publisher = NULL;
if ((err = find_publisher(plaintext, nb_plaintext, &publisher)) != srs_success) {
return srs_error_wrap(err, "find");
Expand Down

0 comments on commit 14bc7bc

Please sign in to comment.