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

refine code for bug #194, add comments to macros.

This commit is contained in:
winlin 2014-11-13 12:45:54 +08:00
parent cc6aca9ad5
commit 4af2e78c59
5 changed files with 34 additions and 8 deletions

View file

@ -69,9 +69,6 @@ using namespace std;
// when edge timeout, retry next.
#define SRS_EDGE_TOKEN_TRAVERSE_TIMEOUT_US (int64_t)(3*1000*1000LL)
// to get msgs then totally send out.
#define SYS_MAX_PLAY_SEND_MSGS 128
SrsRtmpConn::SrsRtmpConn(SrsServer* srs_server, st_netfd_t client_stfd)
: SrsConnection(srs_server, client_stfd)
{
@ -520,7 +517,7 @@ int SrsRtmpConn::playing(SrsSource* source)
// initialize other components
SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_PLAY_USER);
SrsSharedPtrMessageArray msgs(SYS_MAX_PLAY_SEND_MSGS);
SrsSharedPtrMessageArray msgs(SYS_CONSTS_MAX_PLAY_SEND_MSGS);
bool user_specified_duration_to_stop = (req->duration > 0);
int64_t starttime = -1;

View file

@ -50,12 +50,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SERVER_LISTEN_BACKLOG 512
// system interval
// system interval in ms,
// all resolution times should be times togother,
// for example, system-time is 3(300ms),
// then rusage can be 3*x, for instance, 3*10=30(3s),
// the meminfo canbe 30*x, for instance, 30*2=60(6s)
// for performance refine, @see: https://github.com/winlinvip/simple-rtmp-server/issues/194
// @remark, recomment to 1000ms.
#define SRS_SYS_CYCLE_INTERVAL 1000
// update time interval:

View file

@ -216,7 +216,7 @@ int SrsMessageQueue::dump_packets(int max_count, SrsSharedPtrMessage** pmsgs, in
} else {
// erase some vector elements may cause memory copy,
// maybe can use more efficient vector.swap to avoid copy.
// @remark for the pmsgs is big enough, for instance, SYS_MAX_PLAY_SEND_MSGS 128,
// @remark for the pmsgs is big enough, for instance, SYS_CONSTS_MAX_PLAY_SEND_MSGS 128,
// the rtmp play client will get 128msgs once, so this branch rarely execute.
msgs.erase(msgs.begin(), msgs.begin() + count);
}