diff --git a/README.md b/README.md index 634c2ae03..c2d1b3240 100755 --- a/README.md +++ b/README.md @@ -208,6 +208,7 @@ Supported operating systems and hardware: * 2013-10-17, Created.
## History +* v1.0, 2014-09-30, fix [#180](https://github.com/winlinvip/simple-rtmp-server/issues/180), crash for multiple edge publishing the same stream. 0.9.220. * v1.0, 2014-09-26, fix hls bug, refine config and log, according to clion of jetbrains. 0.9.216. * v1.0, 2014-09-25, fix [#177](https://github.com/winlinvip/simple-rtmp-server/issues/177), dvr segment add config dvr_wait_keyframe. 0.9.213. * v1.0, 2014-08-28, fix [#167](https://github.com/winlinvip/simple-rtmp-server/issues/167), add openssl includes to utest. 0.9.209. diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp index 585b13810..cb8d40404 100644 --- a/trunk/src/app/srs_app_edge.cpp +++ b/trunk/src/app/srs_app_edge.cpp @@ -814,13 +814,25 @@ int SrsPublishEdge::on_client_publish() return ret; } - if ((ret = forwarder->start()) != ERROR_SUCCESS) { - return ret; + // @see https://github.com/winlinvip/simple-rtmp-server/issues/180 + // to avoid multiple publish the same stream on the same edge, + // directly enter the publish stage. + if (true) { + SrsEdgeState pstate = state; + state = SrsEdgeStatePublish; + srs_trace("edge change from %d to state %d (push).", pstate, state); } - SrsEdgeState pstate = state; - state = SrsEdgeStatePublish; - srs_trace("edge change from %d to state %d (push).", pstate, state); + // start to forward stream to origin. + ret = forwarder->start(); + + // @see https://github.com/winlinvip/simple-rtmp-server/issues/180 + // when failed, revert to init + if (ret != ERROR_SUCCESS) { + SrsEdgeState pstate = state; + state = SrsEdgeStateInit; + srs_trace("edge revert from %d to state %d (push). ret=%d", pstate, state, ret); + } return ret; } diff --git a/trunk/src/app/srs_app_edge.hpp b/trunk/src/app/srs_app_edge.hpp index 9b0247ca1..d81e09723 100644 --- a/trunk/src/app/srs_app_edge.hpp +++ b/trunk/src/app/srs_app_edge.hpp @@ -57,7 +57,7 @@ enum SrsEdgeState // for play edge SrsEdgeStatePlay = 100, // play stream from origin, ingest stream - SrsEdgeStateIngestConnected, + SrsEdgeStateIngestConnected = 101, // for publish edge SrsEdgeStatePublish = 200, diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 563933e12..2271d486a 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "0" #define VERSION_MINOR "9" -#define VERSION_REVISION "219" +#define VERSION_REVISION "220" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "SRS" diff --git a/trunk/src/main/srs_main_server.cpp b/trunk/src/main/srs_main_server.cpp index 1e82ed8ec..b79a4aa10 100644 --- a/trunk/src/main/srs_main_server.cpp +++ b/trunk/src/main/srs_main_server.cpp @@ -138,6 +138,11 @@ void show_macro_features() int main(int argc, char** argv) { int ret = ERROR_SUCCESS; + +// TODO: FIXME: remove following. +char* ptr = new char[1024]; +delete ptr; +ptr[0] = 0; // TODO: support both little and big endian. srs_assert(srs_is_little_endian());