正在显示
2 个修改的文件
包含
8 行增加
和
1 行删除
| @@ -95,6 +95,7 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* svr, st_netfd_t c) | @@ -95,6 +95,7 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* svr, st_netfd_t c) | ||
| 95 | realtime = SRS_PERF_MIN_LATENCY_ENABLED; | 95 | realtime = SRS_PERF_MIN_LATENCY_ENABLED; |
| 96 | send_min_interval = 0; | 96 | send_min_interval = 0; |
| 97 | tcp_nodelay = false; | 97 | tcp_nodelay = false; |
| 98 | + client_type = SrsRtmpConnUnknown; | ||
| 98 | 99 | ||
| 99 | _srs_config->subscribe(this); | 100 | _srs_config->subscribe(this); |
| 100 | } | 101 | } |
| @@ -506,6 +507,7 @@ int SrsRtmpConn::stream_service_cycle() | @@ -506,6 +507,7 @@ int SrsRtmpConn::stream_service_cycle() | ||
| 506 | source->source_id(), source->source_id()); | 507 | source->source_id(), source->source_id()); |
| 507 | source->set_cache(enabled_cache); | 508 | source->set_cache(enabled_cache); |
| 508 | 509 | ||
| 510 | + client_type = type; | ||
| 509 | switch (type) { | 511 | switch (type) { |
| 510 | case SrsRtmpConnPlay: { | 512 | case SrsRtmpConnPlay: { |
| 511 | srs_verbose("start to play stream %s.", req->stream.c_str()); | 513 | srs_verbose("start to play stream %s.", req->stream.c_str()); |
| @@ -828,7 +830,9 @@ int SrsRtmpConn::publishing(SrsSource* source) | @@ -828,7 +830,9 @@ int SrsRtmpConn::publishing(SrsSource* source) | ||
| 828 | // use isolate thread to recv, | 830 | // use isolate thread to recv, |
| 829 | // @see: https://github.com/ossrs/srs/issues/237 | 831 | // @see: https://github.com/ossrs/srs/issues/237 |
| 830 | SrsPublishRecvThread trd(rtmp, req, | 832 | SrsPublishRecvThread trd(rtmp, req, |
| 831 | - st_netfd_fileno(stfd), 0, this, source, true, vhost_is_edge); | 833 | + st_netfd_fileno(stfd), 0, this, source, |
| 834 | + client_type == SrsRtmpConnFMLEPublish, | ||
| 835 | + vhost_is_edge); | ||
| 832 | 836 | ||
| 833 | srs_info("start to publish stream %s success", req->stream.c_str()); | 837 | srs_info("start to publish stream %s success", req->stream.c_str()); |
| 834 | ret = do_publishing(source, &trd); | 838 | ret = do_publishing(source, &trd); |
| @@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 33 | #include <srs_app_st.hpp> | 33 | #include <srs_app_st.hpp> |
| 34 | #include <srs_app_conn.hpp> | 34 | #include <srs_app_conn.hpp> |
| 35 | #include <srs_app_reload.hpp> | 35 | #include <srs_app_reload.hpp> |
| 36 | +#include <srs_rtmp_stack.hpp> | ||
| 36 | 37 | ||
| 37 | class SrsServer; | 38 | class SrsServer; |
| 38 | class SrsRtmpServer; | 39 | class SrsRtmpServer; |
| @@ -93,6 +94,8 @@ private: | @@ -93,6 +94,8 @@ private: | ||
| 93 | int publish_normal_timeout; | 94 | int publish_normal_timeout; |
| 94 | // whether enable the tcp_nodelay. | 95 | // whether enable the tcp_nodelay. |
| 95 | bool tcp_nodelay; | 96 | bool tcp_nodelay; |
| 97 | + // The type of client, play or publish. | ||
| 98 | + SrsRtmpConnType client_type; | ||
| 96 | public: | 99 | public: |
| 97 | SrsRtmpConn(SrsServer* svr, st_netfd_t c); | 100 | SrsRtmpConn(SrsServer* svr, st_netfd_t c); |
| 98 | virtual ~SrsRtmpConn(); | 101 | virtual ~SrsRtmpConn(); |
-
请 注册 或 登录 后发表评论