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

for #441, use 30s timeout for first msg. 2.0.178

This commit is contained in:
winlin 2015-07-16 17:30:27 +08:00
parent 5f77724021
commit 366d3a3f56
4 changed files with 12 additions and 3 deletions

View file

@ -782,8 +782,14 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd)
while (!disposed) {
pprint->elapse();
// cond wait for error.
trd->wait(SRS_CONSTS_RTMP_PUBLISHER_RECV_TIMEOUT_US / 1000);
// cond wait for timeout.
if (nb_msgs == 0) {
// when not got msgs, wait for a larger timeout.
// @see https://github.com/simple-rtmp-server/srs/issues/441
trd->wait(SRS_CONSTS_RTMP_PUBLISHER_NO_MSG_RECV_TIMEOUT_US / 1000);
} else {
trd->wait(SRS_CONSTS_RTMP_PUBLISHER_RECV_TIMEOUT_US / 1000);
}
// check the thread error code.
if ((ret = trd->error_code()) != ERROR_SUCCESS) {