防止ingester多次调用stop导致崩溃

pull/1963/head
chenchengbin 5 years ago committed by winlin
parent 63b5c51748
commit 0aecc063e0

@ -690,6 +690,7 @@ void SrsPlayEdge::on_all_client_stop()
// when all client disconnected, // when all client disconnected,
// and edge is ingesting origin stream, abort it. // and edge is ingesting origin stream, abort it.
if (state == SrsEdgeStatePlay || state == SrsEdgeStateIngestConnected) { if (state == SrsEdgeStatePlay || state == SrsEdgeStateIngestConnected) {
state = SrsEdgeStateIngestStoping; // avoid multi call stop
ingester->stop(); ingester->stop();
SrsEdgeState pstate = state; SrsEdgeState pstate = state;

@ -57,6 +57,7 @@ enum SrsEdgeState
// play stream from origin, ingest stream // play stream from origin, ingest stream
SrsEdgeStateIngestConnected = 101, SrsEdgeStateIngestConnected = 101,
SrsEdgeStateIngestStoping = 1000,
// For publish edge // For publish edge
SrsEdgeStatePublish = 200, SrsEdgeStatePublish = 200,
}; };

Loading…
Cancel
Save