正在显示
2 个修改的文件
包含
6 行增加
和
2 行删除
| @@ -129,9 +129,9 @@ public: | @@ -129,9 +129,9 @@ public: | ||
| 129 | }; | 129 | }; |
| 130 | 130 | ||
| 131 | /** | 131 | /** |
| 132 | - * the publish recv thread got message and callback the source method to process message. | 132 | +* the publish recv thread got message and callback the source method to process message. |
| 133 | * @see: https://github.com/winlinvip/simple-rtmp-server/issues/237 | 133 | * @see: https://github.com/winlinvip/simple-rtmp-server/issues/237 |
| 134 | - */ | 134 | +*/ |
| 135 | class SrsPublishRecvThread : public ISrsMessageHandler | 135 | class SrsPublishRecvThread : public ISrsMessageHandler |
| 136 | { | 136 | { |
| 137 | private: | 137 | private: |
| @@ -179,8 +179,12 @@ failed: | @@ -179,8 +179,12 @@ failed: | ||
| 179 | break; | 179 | break; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | + // to improve performance, donot sleep when interval is zero. | ||
| 183 | + // @see: https://github.com/winlinvip/simple-rtmp-server/issues/237 | ||
| 184 | + if (cycle_interval_us > 0) { | ||
| 182 | st_usleep(cycle_interval_us); | 185 | st_usleep(cycle_interval_us); |
| 183 | } | 186 | } |
| 187 | + } | ||
| 184 | 188 | ||
| 185 | handler->on_thread_stop(); | 189 | handler->on_thread_stop(); |
| 186 | srs_info("thread cycle finished"); | 190 | srs_info("thread cycle finished"); |
-
请 注册 或 登录 后发表评论