From cff4c07be43da56fc30032efb3f416477575de69 Mon Sep 17 00:00:00 2001 From: long Date: Wed, 30 Jun 2021 07:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=BC=80rtmp=E8=BD=ACrtc=EF=BC=8C?= =?UTF-8?q?=E5=BD=93rtmp=E9=87=8D=E5=A4=8D=E6=8E=A8=E6=B5=81=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E7=AC=AC2=E8=B7=AF=E4=BC=9A=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=E7=AC=AC1=E8=B7=AF=E6=B5=81=E7=9A=84=E6=AD=A3=E5=B8=B8?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E3=80=82=20(#2448)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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> --- trunk/src/app/srs_app_rtmp_conn.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 78ce829f8..246dcfd62 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -944,6 +944,11 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsLiveSource* source) 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. #ifdef SRS_RTC SrsRtcSource *rtc = NULL; @@ -955,16 +960,11 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsLiveSource* source) } 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 - // 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. #if defined(SRS_RTC) && defined(SRS_FFMPEG_FIT) if (rtc) {