Skip to content

Commit

Permalink
RTC: fix play rtc judge for config rtc2rtmp on.(#2863)
Browse files Browse the repository at this point in the history
  • Loading branch information
chundonglinlin committed Jan 11, 2022
1 parent e08c68b commit 5c2bed1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions trunk/src/app/srs_app_rtc_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,12 @@ srs_error_t SrsGoApiRtcPlay::do_serve_http(ISrsHttpResponseWriter* w, ISrsHttpMe

// For RTMP to RTC, fail if disabled and RTMP is active, see https://github.com/ossrs/srs/issues/2728
if (!_srs_config->get_rtc_from_rtmp(ruc.req_->vhost)) {
SrsLiveSource* rtmp = _srs_sources->fetch(ruc.req_);
if (rtmp && !rtmp->inactive()) {
return srs_error_new(ERROR_RTC_DISABLED, "Disabled rtmp_to_rtc of %s, see #2728", ruc.req_->vhost.c_str());
// FIX ERR: when config is { rtmp_to_rtc off; rtc_to_rtmp on; }, playing rtc will be rejected if publishing rtc stream.
if (!_srs_config->get_rtc_to_rtmp(ruc.req_->vhost)) {
SrsLiveSource* rtmp = _srs_sources->fetch(ruc.req_);
if (rtmp && !rtmp->inactive()) {
return srs_error_new(ERROR_RTC_DISABLED, "Disabled rtmp_to_rtc of %s, see #2728", ruc.req_->vhost.c_str());
}
}
}

Expand Down

0 comments on commit 5c2bed1

Please sign in to comment.