From 0aecc063e04df50f3bd4e829cab69050e8db774c Mon Sep 17 00:00:00 2001 From: chenchengbin Date: Wed, 1 Apr 2020 09:55:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=98=B2=E6=AD=A2ingester=E5=A4=9A?= =?UTF-8?q?=E6=AC=A1=E8=B0=83=E7=94=A8stop=E5=AF=BC=E8=87=B4=E5=B4=A9?= =?UTF-8?q?=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trunk/src/app/srs_app_edge.cpp | 1 + trunk/src/app/srs_app_edge.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp index 8c057af51..dc09ee0c8 100644 --- a/trunk/src/app/srs_app_edge.cpp +++ b/trunk/src/app/srs_app_edge.cpp @@ -690,6 +690,7 @@ void SrsPlayEdge::on_all_client_stop() // when all client disconnected, // and edge is ingesting origin stream, abort it. if (state == SrsEdgeStatePlay || state == SrsEdgeStateIngestConnected) { + state = SrsEdgeStateIngestStoping; // avoid multi call stop ingester->stop(); SrsEdgeState pstate = state; diff --git a/trunk/src/app/srs_app_edge.hpp b/trunk/src/app/srs_app_edge.hpp index 4c7249614..778c7b592 100644 --- a/trunk/src/app/srs_app_edge.hpp +++ b/trunk/src/app/srs_app_edge.hpp @@ -57,6 +57,7 @@ enum SrsEdgeState // play stream from origin, ingest stream SrsEdgeStateIngestConnected = 101, + SrsEdgeStateIngestStoping = 1000, // For publish edge SrsEdgeStatePublish = 200, }; From 905444a1c7e3ebd8784210cfcb1854b760353893 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 14 Sep 2020 20:48:44 +0800 Subject: [PATCH 2/2] For #1684, Prevent stop ingest for multiple times. 3.0.143 --- README.md | 1 + trunk/src/app/srs_app_edge.cpp | 9 +++++---- trunk/src/app/srs_app_edge.hpp | 6 ++++-- trunk/src/core/srs_core_version3.hpp | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6f5ab8261..7783cd0e1 100755 --- a/README.md +++ b/README.md @@ -149,6 +149,7 @@ For previous versions, please read: ## V3 changes +* v3.0, 2020-09-14, Prevent stop ingest for multiple times. 3.0.143 * v3.0, 2020-09-10, RTC: Change SO_REUSEPORT fail to warning. 3.0.142 * v3.0, 2020-06-27, [3.0 release0(3.0.141)][r3.0r0] released. 122674 lines. * v3.0, 2020-03-30, For [#1672][bug #1672], fix dvr close file failed bug. 3.0.140 diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp index dc09ee0c8..63237fba5 100644 --- a/trunk/src/app/srs_app_edge.cpp +++ b/trunk/src/app/srs_app_edge.cpp @@ -690,12 +690,13 @@ void SrsPlayEdge::on_all_client_stop() // when all client disconnected, // and edge is ingesting origin stream, abort it. if (state == SrsEdgeStatePlay || state == SrsEdgeStateIngestConnected) { - state = SrsEdgeStateIngestStoping; // avoid multi call stop - ingester->stop(); - SrsEdgeState pstate = state; + state = SrsEdgeStateIngestStopping; + + ingester->stop(); + state = SrsEdgeStateInit; - srs_trace("edge change from %d to state %d (init).", pstate, state); + srs_trace("edge change from %d to %d then %d (init).", pstate, SrsEdgeStateIngestStopping, state); return; } diff --git a/trunk/src/app/srs_app_edge.hpp b/trunk/src/app/srs_app_edge.hpp index 778c7b592..bb95c112e 100644 --- a/trunk/src/app/srs_app_edge.hpp +++ b/trunk/src/app/srs_app_edge.hpp @@ -56,10 +56,12 @@ enum SrsEdgeState SrsEdgeStatePlay = 100, // play stream from origin, ingest stream SrsEdgeStateIngestConnected = 101, - - SrsEdgeStateIngestStoping = 1000, + // For publish edge SrsEdgeStatePublish = 200, + + // We are stopping edge ingesting. + SrsEdgeStateIngestStopping = 300, }; // The state of edge from user, manual machine diff --git a/trunk/src/core/srs_core_version3.hpp b/trunk/src/core/srs_core_version3.hpp index 79bbf7249..b5a54ac4b 100644 --- a/trunk/src/core/srs_core_version3.hpp +++ b/trunk/src/core/srs_core_version3.hpp @@ -24,6 +24,6 @@ #ifndef SRS_CORE_VERSION3_HPP #define SRS_CORE_VERSION3_HPP -#define SRS_VERSION3_REVISION 142 +#define SRS_VERSION3_REVISION 143 #endif