1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Prevent DTLS ARQ packet to dup play/publish

This commit is contained in:
winlin 2020-07-02 14:51:11 +08:00
parent 9ff8bff601
commit 69fc1ba711

View file

@ -2006,7 +2006,11 @@ srs_error_t SrsRtcSession::start_play()
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
srs_freep(player_); // If player is initialized, we think the session is started.
// To prevent play multiple times for the DTLS ARQ packet.
if (player_) {
return err;
}
player_ = new SrsRtcPlayer(this, _srs_context->get_id()); player_ = new SrsRtcPlayer(this, _srs_context->get_id());
uint32_t video_ssrc = 0; uint32_t video_ssrc = 0;
@ -2039,7 +2043,11 @@ srs_error_t SrsRtcSession::start_publish()
{ {
srs_error_t err = srs_success; srs_error_t err = srs_success;
srs_freep(publisher_); // If publisher is initialized, we think the session is started.
// To prevent publish multiple times for the DTLS ARQ packet.
if (publisher_) {
return err;
}
publisher_ = new SrsRtcPublisher(this); publisher_ = new SrsRtcPublisher(this);
// Request PLI for exists players? // Request PLI for exists players?
//publisher_->request_keyframe(); //publisher_->request_keyframe();