1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

fix #251, revert changes, for the cond wait and fast cache queue is no use. 2.0.59

This commit is contained in:
winlin 2014-12-05 20:55:19 +08:00
parent 92ecdf088b
commit e80c8603d4
6 changed files with 24 additions and 234 deletions

View file

@ -598,29 +598,19 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsQueueRecvThread* trd)
// collect elapse for pithy print.
pithy_print.elapse();
#ifdef SRS_PERF_QUEUE_COND_WAIT
// wait for message to incoming.
// @see https://github.com/winlinvip/simple-rtmp-server/issues/251
consumer->wait(SRS_PERF_MW_MIN_MSGS, mw_sleep);
#endif
// get messages from consumer.
// each msg in msgs.msgs must be free, for the SrsMessageArray never free them.
int count = 0;
if ((ret = consumer->dump_packets(&msgs, &count)) != ERROR_SUCCESS) {
if ((ret = consumer->dump_packets(&msgs, count)) != ERROR_SUCCESS) {
srs_error("get messages from consumer failed. ret=%d", ret);
return ret;
}
#ifdef SRS_PERF_QUEUE_COND_WAIT
// we use wait to get messages, so the count must be positive.
srs_assert(count > 0);
#else
// no messages, sleep for a while.
if (count <= 0) {
st_usleep(mw_sleep * 1000);
}
#endif
srs_info("got %d msgs, min=%d, mw=%d", count, SRS_PERF_MW_MIN_MSGS, mw_sleep);
srs_info("got %d msgs, mw=%d", count, mw_sleep);
// reportable
if (pithy_print.can_print()) {