From bd506da07044bd3e447fe51ce3178da7ba45fb5c Mon Sep 17 00:00:00 2001 From: chenhaibo Date: Thu, 20 May 2021 15:48:34 +0800 Subject: [PATCH] Fix #2366, bug when disabled gb28181. --- AUTHORS.txt | 2 +- trunk/src/app/srs_app_rtmp_conn.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index f16b2c853..099d3d620 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -73,7 +73,7 @@ CONTRIBUTORS ordered by first contribution. * liulichuan * yapingcat * chenchengbin -* chenhaibo +* chenhaibo * jasongwq * xialixin * yinjiaoyuan diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 1f1b256cb..738a0e4a2 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -961,12 +961,14 @@ srs_error_t SrsRtmpConn::acquire_publish(SrsLiveSource* source) SrsRequest* req = info->req; - // @see https://github.com/ossrs/srs/issues/2364 + // @see https://github.com/ossrs/srs/issues/2364 // Check whether GB28181 stream is busy. #if defined(SRS_GB28181) - SrsGb28181RtmpMuxer* gb28181 = _srs_gb28181->fetch_rtmpmuxer(req->stream); - if (gb28181 != NULL) { - return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "gb28181 stream %s busy", req->get_stream_url().c_str()); + if (_srs_gb28181 != NULL) { + SrsGb28181RtmpMuxer* gb28181 = _srs_gb28181->fetch_rtmpmuxer(req->stream); + if (gb28181 != NULL) { + return srs_error_new(ERROR_SYSTEM_STREAM_BUSY, "gb28181 stream %s busy", req->get_stream_url().c_str()); + } } #endif