From 46330dd196fb36424550db7235cdc00481e9c9a1 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 11 Nov 2014 13:40:09 +0800 Subject: [PATCH] fix #195: remove the confuse code st_usleep(0). 2.0.13. --- README.md | 1 + trunk/src/app/srs_app_edge.cpp | 6 ------ trunk/src/app/srs_app_forward.cpp | 3 --- trunk/src/app/srs_app_rtmp_conn.cpp | 9 --------- trunk/src/app/srs_app_thread.hpp | 2 -- trunk/src/core/srs_core.hpp | 2 +- 6 files changed, 2 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 7c5a9dde0..8f4a7943e 100755 --- a/README.md +++ b/README.md @@ -242,6 +242,7 @@ Supported operating systems and hardware: * 2013-10-17, Created.
## History +* v2.0, 2014-11-08, fix [#195](https://github.com/winlinvip/simple-rtmp-server/issues/195), remove the confuse code st_usleep(0). 2.0.13. * v2.0, 2014-11-08, fix [#191](https://github.com/winlinvip/simple-rtmp-server/issues/191), configure --export-librtmp-project and --export-librtmp-single. 2.0.11. * v2.0, 2014-11-08, fix [#66](https://github.com/winlinvip/simple-rtmp-server/issues/66), srs-librtmp support write h264 raw packet. 2.0.9. * v2.0, 2014-10-25, fix [#185](https://github.com/winlinvip/simple-rtmp-server/issues/185), AMF0 support 0x0B the date type codec. 2.0.7. diff --git a/trunk/src/app/srs_app_edge.cpp b/trunk/src/app/srs_app_edge.cpp index cb8d40404..d91e27700 100644 --- a/trunk/src/app/srs_app_edge.cpp +++ b/trunk/src/app/srs_app_edge.cpp @@ -170,9 +170,6 @@ int SrsEdgeIngester::ingest() SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_EDGE); while (pthread->can_loop()) { - // switch to other st-threads. - st_usleep(0); - pithy_print.elapse(); // pithy print @@ -480,9 +477,6 @@ int SrsEdgeForwarder::cycle() SrsSharedPtrMessageArray msgs(SYS_MAX_EDGE_SEND_MSGS); while (pthread->can_loop()) { - // switch to other st-threads. - st_usleep(0); - if (send_error_code != ERROR_SUCCESS) { st_usleep(SRS_EDGE_FORWARDER_ERROR_US); continue; diff --git a/trunk/src/app/srs_app_forward.cpp b/trunk/src/app/srs_app_forward.cpp index 3a54dd618..78360d6de 100644 --- a/trunk/src/app/srs_app_forward.cpp +++ b/trunk/src/app/srs_app_forward.cpp @@ -399,9 +399,6 @@ int SrsForwarder::forward() } while (pthread->can_loop()) { - // switch to other st-threads. - st_usleep(0); - pithy_print.elapse(); // read from client. diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 97aefb326..df543c7a3 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -608,9 +608,6 @@ int SrsRtmpConn::playing(SrsSource* source) return ret; } } - - // switch to other threads, to anti dead loop. - st_usleep(0); } return ret; @@ -668,9 +665,6 @@ int SrsRtmpConn::do_fmle_publishing(SrsSource* source) } while (true) { - // switch to other st-threads. - st_usleep(0); - SrsMessage* msg = NULL; if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) { srs_error("fmle recv identify client message failed. ret=%d", ret); @@ -774,9 +768,6 @@ int SrsRtmpConn::do_flash_publishing(SrsSource* source) } while (true) { - // switch to other st-threads. - st_usleep(0); - SrsMessage* msg = NULL; if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) { if (!srs_is_client_gracefully_close(ret)) { diff --git a/trunk/src/app/srs_app_thread.hpp b/trunk/src/app/srs_app_thread.hpp index 34801824e..debfd216f 100644 --- a/trunk/src/app/srs_app_thread.hpp +++ b/trunk/src/app/srs_app_thread.hpp @@ -50,14 +50,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * espectially on st_usleep(), so the cycle must check the loop, * when handler->cycle() has loop itself, for example: * while (true): -* st_usleep(0); * if (read_from_socket(skt) < 0) break; * if thread stop when read_from_socket, it's ok, the loop will break, * but when thread stop interrupt the s_usleep(0), then the loop is * death loop. * in a word, the handler->cycle() must: * while (pthread->can_loop()): -* st_usleep(0); * if (read_from_socket(skt) < 0) break; * check the loop, then it works. * diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 3cae04a8c..0e7e612c3 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 2 #define VERSION_MINOR 0 -#define VERSION_REVISION 12 +#define VERSION_REVISION 13 // server info. #define RTMP_SIG_SRS_KEY "SRS" #define RTMP_SIG_SRS_ROLE "origin/edge server"