正在显示
2 个修改的文件
包含
10 行增加
和
3 行删除
| @@ -513,14 +513,19 @@ int SrsRtmpConn::playing(SrsSource* source) | @@ -513,14 +513,19 @@ int SrsRtmpConn::playing(SrsSource* source) | ||
| 513 | SrsAutoFree(SrsConsumer, consumer); | 513 | SrsAutoFree(SrsConsumer, consumer); |
| 514 | srs_verbose("consumer created success."); | 514 | srs_verbose("consumer created success."); |
| 515 | 515 | ||
| 516 | - rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); | ||
| 517 | - | ||
| 518 | // initialize other components | 516 | // initialize other components |
| 519 | SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_PLAY_USER); | 517 | SrsPithyPrint pithy_print(SRS_CONSTS_STAGE_PLAY_USER); |
| 520 | SrsMessageArray msgs(SYS_CONSTS_MAX_PLAY_SEND_MSGS); | 518 | SrsMessageArray msgs(SYS_CONSTS_MAX_PLAY_SEND_MSGS); |
| 521 | bool user_specified_duration_to_stop = (req->duration > 0); | 519 | bool user_specified_duration_to_stop = (req->duration > 0); |
| 522 | int64_t starttime = -1; | 520 | int64_t starttime = -1; |
| 523 | 521 | ||
| 522 | + // TODO: use isolate thread to recv, | ||
| 523 | + // @see: https://github.com/winlinvip/simple-rtmp-server/issues/196 | ||
| 524 | + // the performance bottleneck not in the timeout recv, but | ||
| 525 | + // in the multiple messages send, so it's ok for timeout recv, | ||
| 526 | + // @see https://github.com/winlinvip/simple-rtmp-server/issues/194 | ||
| 527 | + rtmp->set_recv_timeout(SRS_CONSTS_RTMP_PULSE_TIMEOUT_US); | ||
| 528 | + | ||
| 524 | while (true) { | 529 | while (true) { |
| 525 | // TODO: to use isolate thread to recv, can improve about 5% performance. | 530 | // TODO: to use isolate thread to recv, can improve about 5% performance. |
| 526 | // @see: https://github.com/winlinvip/simple-rtmp-server/issues/196 | 531 | // @see: https://github.com/winlinvip/simple-rtmp-server/issues/196 |
| @@ -212,7 +212,9 @@ private: | @@ -212,7 +212,9 @@ private: | ||
| 212 | // peer out | 212 | // peer out |
| 213 | private: | 213 | private: |
| 214 | /** | 214 | /** |
| 215 | - * cache for multiple messages send | 215 | + * cache for multiple messages send, |
| 216 | + * initialize to iovec[SRS_CONSTS_IOVS_MAX] and realloc when consumed, | ||
| 217 | + * it's ok to realloc the iovs cache, for all ptr is ok. | ||
| 216 | */ | 218 | */ |
| 217 | iovec* out_iovs; | 219 | iovec* out_iovs; |
| 218 | int nb_out_iovs; | 220 | int nb_out_iovs; |
-
请 注册 或 登录 后发表评论