正在显示
6 个修改的文件
包含
2 行增加
和
21 行删除
| @@ -242,6 +242,7 @@ Supported operating systems and hardware: | @@ -242,6 +242,7 @@ Supported operating systems and hardware: | ||
| 242 | * 2013-10-17, Created.<br/> | 242 | * 2013-10-17, Created.<br/> |
| 243 | 243 | ||
| 244 | ## History | 244 | ## History |
| 245 | +* 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. | ||
| 245 | * 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. | 246 | * 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. |
| 246 | * 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. | 247 | * 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. |
| 247 | * 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. | 248 | * 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. |
| @@ -170,9 +170,6 @@ int SrsEdgeIngester::ingest() | @@ -170,9 +170,6 @@ int SrsEdgeIngester::ingest() | ||
| 170 | SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_EDGE); | 170 | SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_EDGE); |
| 171 | 171 | ||
| 172 | while (pthread->can_loop()) { | 172 | while (pthread->can_loop()) { |
| 173 | - // switch to other st-threads. | ||
| 174 | - st_usleep(0); | ||
| 175 | - | ||
| 176 | pithy_print.elapse(); | 173 | pithy_print.elapse(); |
| 177 | 174 | ||
| 178 | // pithy print | 175 | // pithy print |
| @@ -480,9 +477,6 @@ int SrsEdgeForwarder::cycle() | @@ -480,9 +477,6 @@ int SrsEdgeForwarder::cycle() | ||
| 480 | SrsSharedPtrMessageArray msgs(SYS_MAX_EDGE_SEND_MSGS); | 477 | SrsSharedPtrMessageArray msgs(SYS_MAX_EDGE_SEND_MSGS); |
| 481 | 478 | ||
| 482 | while (pthread->can_loop()) { | 479 | while (pthread->can_loop()) { |
| 483 | - // switch to other st-threads. | ||
| 484 | - st_usleep(0); | ||
| 485 | - | ||
| 486 | if (send_error_code != ERROR_SUCCESS) { | 480 | if (send_error_code != ERROR_SUCCESS) { |
| 487 | st_usleep(SRS_EDGE_FORWARDER_ERROR_US); | 481 | st_usleep(SRS_EDGE_FORWARDER_ERROR_US); |
| 488 | continue; | 482 | continue; |
| @@ -399,9 +399,6 @@ int SrsForwarder::forward() | @@ -399,9 +399,6 @@ int SrsForwarder::forward() | ||
| 399 | } | 399 | } |
| 400 | 400 | ||
| 401 | while (pthread->can_loop()) { | 401 | while (pthread->can_loop()) { |
| 402 | - // switch to other st-threads. | ||
| 403 | - st_usleep(0); | ||
| 404 | - | ||
| 405 | pithy_print.elapse(); | 402 | pithy_print.elapse(); |
| 406 | 403 | ||
| 407 | // read from client. | 404 | // read from client. |
| @@ -608,9 +608,6 @@ int SrsRtmpConn::playing(SrsSource* source) | @@ -608,9 +608,6 @@ int SrsRtmpConn::playing(SrsSource* source) | ||
| 608 | return ret; | 608 | return ret; |
| 609 | } | 609 | } |
| 610 | } | 610 | } |
| 611 | - | ||
| 612 | - // switch to other threads, to anti dead loop. | ||
| 613 | - st_usleep(0); | ||
| 614 | } | 611 | } |
| 615 | 612 | ||
| 616 | return ret; | 613 | return ret; |
| @@ -668,9 +665,6 @@ int SrsRtmpConn::do_fmle_publishing(SrsSource* source) | @@ -668,9 +665,6 @@ int SrsRtmpConn::do_fmle_publishing(SrsSource* source) | ||
| 668 | } | 665 | } |
| 669 | 666 | ||
| 670 | while (true) { | 667 | while (true) { |
| 671 | - // switch to other st-threads. | ||
| 672 | - st_usleep(0); | ||
| 673 | - | ||
| 674 | SrsMessage* msg = NULL; | 668 | SrsMessage* msg = NULL; |
| 675 | if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) { | 669 | if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) { |
| 676 | srs_error("fmle recv identify client message failed. ret=%d", ret); | 670 | srs_error("fmle recv identify client message failed. ret=%d", ret); |
| @@ -774,9 +768,6 @@ int SrsRtmpConn::do_flash_publishing(SrsSource* source) | @@ -774,9 +768,6 @@ int SrsRtmpConn::do_flash_publishing(SrsSource* source) | ||
| 774 | } | 768 | } |
| 775 | 769 | ||
| 776 | while (true) { | 770 | while (true) { |
| 777 | - // switch to other st-threads. | ||
| 778 | - st_usleep(0); | ||
| 779 | - | ||
| 780 | SrsMessage* msg = NULL; | 771 | SrsMessage* msg = NULL; |
| 781 | if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) { | 772 | if ((ret = rtmp->recv_message(&msg)) != ERROR_SUCCESS) { |
| 782 | if (!srs_is_client_gracefully_close(ret)) { | 773 | if (!srs_is_client_gracefully_close(ret)) { |
| @@ -50,14 +50,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -50,14 +50,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 50 | * espectially on st_usleep(), so the cycle must check the loop, | 50 | * espectially on st_usleep(), so the cycle must check the loop, |
| 51 | * when handler->cycle() has loop itself, for example: | 51 | * when handler->cycle() has loop itself, for example: |
| 52 | * while (true): | 52 | * while (true): |
| 53 | -* st_usleep(0); | ||
| 54 | * if (read_from_socket(skt) < 0) break; | 53 | * if (read_from_socket(skt) < 0) break; |
| 55 | * if thread stop when read_from_socket, it's ok, the loop will break, | 54 | * if thread stop when read_from_socket, it's ok, the loop will break, |
| 56 | * but when thread stop interrupt the s_usleep(0), then the loop is | 55 | * but when thread stop interrupt the s_usleep(0), then the loop is |
| 57 | * death loop. | 56 | * death loop. |
| 58 | * in a word, the handler->cycle() must: | 57 | * in a word, the handler->cycle() must: |
| 59 | * while (pthread->can_loop()): | 58 | * while (pthread->can_loop()): |
| 60 | -* st_usleep(0); | ||
| 61 | * if (read_from_socket(skt) < 0) break; | 59 | * if (read_from_socket(skt) < 0) break; |
| 62 | * check the loop, then it works. | 60 | * check the loop, then it works. |
| 63 | * | 61 | * |
| @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 31 | // current release version | 31 | // current release version |
| 32 | #define VERSION_MAJOR 2 | 32 | #define VERSION_MAJOR 2 |
| 33 | #define VERSION_MINOR 0 | 33 | #define VERSION_MINOR 0 |
| 34 | -#define VERSION_REVISION 12 | 34 | +#define VERSION_REVISION 13 |
| 35 | // server info. | 35 | // server info. |
| 36 | #define RTMP_SIG_SRS_KEY "SRS" | 36 | #define RTMP_SIG_SRS_KEY "SRS" |
| 37 | #define RTMP_SIG_SRS_ROLE "origin/edge server" | 37 | #define RTMP_SIG_SRS_ROLE "origin/edge server" |
-
请 注册 或 登录 后发表评论