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

打开rtmp转rtc,当rtmp重复推流时,第2路会影响第1路流的正常播放。 (#2448)

* Update srs_app_rtmp_conn.cpp

修复推重复的RTMP流导致的RTC和RTMP播放的问题

* change ERROR_RTC_SOURCE_BUSY to ERROR_SYSTEM_STREAM_BUSY

change ERROR_RTC_SOURCE_BUSY to ERROR_SYSTEM_STREAM_BUSY

Co-authored-by: Haibo Chen <495810242@qq.com>
This commit is contained in:
long 2021-06-30 07:24:12 +08:00 committed by GitHub
parent cbca6d94d1
commit cff4c07be4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -944,6 +944,11 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsLiveSource* source)
SrsRequest* req = info->req; SrsRequest* req = info->req;
// Check whether RTMP stream is busy.
if (!source->can_publish(info->edge)) {
return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtmp: stream %s is busy", req->get_stream_url().c_str());
}
// Check whether RTC stream is busy. // Check whether RTC stream is busy.
#ifdef SRS_RTC #ifdef SRS_RTC
SrsRtcSource *rtc = NULL; SrsRtcSource *rtc = NULL;
@ -955,16 +960,11 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsLiveSource* source)
} }
if (!rtc->can_publish()) { if (!rtc->can_publish()) {
return srs_error_new(ERROR_RTC_SOURCE_BUSY, "rtc stream %s busy", req->get_stream_url().c_str()); return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtc stream %s busy", req->get_stream_url().c_str());
} }
} }
#endif #endif
// Check whether RTMP stream is busy.
if (!source->can_publish(info->edge)) {
return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "rtmp: stream %s is busy", req->get_stream_url().c_str());
}
// Bridge to RTC streaming. // Bridge to RTC streaming.
#if defined(SRS_RTC) && defined(SRS_FFMPEG_FIT) #if defined(SRS_RTC) && defined(SRS_FFMPEG_FIT)
if (rtc) { if (rtc) {