winlin

add comments for bug #194, #196

... ... @@ -513,14 +513,19 @@ int SrsRtmpConn::playing(SrsSource* source)
SrsAutoFree(SrsConsumer, consumer);
srs_verbose("consumer created success.");
rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US);
// initialize other components
SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_PLAY_USER);
SrsMessageArray msgs(SYS_CONSTS_MAX_PLAY_SEND_MSGS);
bool user_specified_duration_to_stop = (req->duration > 0);
int64_t starttime = -1;
// TODO: use isolate thread to recv,
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/196
// the performance bottleneck not in the timeout recv, but
// in the multiple messages send, so it's ok for timeout recv,
// @see https://github.com/winlinvip/simple-rtmp-server/issues/194
rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US);
while (true) {
// TODO: to use isolate thread to recv, can improve about 5% performance.
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/196
... ...
... ... @@ -212,7 +212,9 @@ private:
// peer out
private:
/**
* cache for multiple messages send
* cache for multiple messages send,
* initialize to iovec[SRS_CONSTS_IOVS_MAX] and realloc when consumed,
* it's ok to realloc the iovs cache, for all ptr is ok.
*/
iovec* out_iovs;
int nb_out_iovs;
... ...