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

for bug #194, use play fd poll, create the singleton poll

This commit is contained in:
winlin 2014-11-11 17:54:02 +08:00
parent efc85ed6df
commit 133cc62b51
6 changed files with 182 additions and 1 deletions

View file

@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_source.hpp>
#include <srs_app_utility.hpp>
#include <srs_app_heartbeat.hpp>
#include <srs_app_poll.hpp>
// signal defines.
#define SIGNAL_RELOAD SIGHUP
@ -664,6 +665,14 @@ int SrsServer::do_cycle()
{
int ret = ERROR_SUCCESS;
// start the poll for play clients.
// performance issue, @see: https://github.com/winlinvip/simple-rtmp-server/issues/194
SrsPoll* poll = SrsPoll::instance();
if ((ret = poll->start()) != ERROR_SUCCESS) {
srs_error("start poll failed. ret=%d", ret);
return ret;
}
// find the max loop
int max = srs_max(0, SRS_SYS_TIME_RESOLUTION_MS_TIMES);