fix #195: remove the confuse code st_usleep(0). 2.0.13.

pull/133/head
winlin 10 years ago
parent 4f34ac022f
commit 46330dd196

@ -242,6 +242,7 @@ Supported operating systems and hardware:
* 2013-10-17, Created.<br/>
## 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.

@ -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;

@ -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.

@ -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)) {

@ -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.
*

@ -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"

Loading…
Cancel
Save