From 954bb186c10907714c9a85f0df2fec2418131e99 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 23 Jan 2017 16:43:43 +0800 Subject: [PATCH] identify the flash and fmle for recv thread. --- trunk/src/app/srs_app_rtmp_conn.cpp | 6 +++++- trunk/src/app/srs_app_rtmp_conn.hpp | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 5d2ccd97b5..12a00925e5 100755 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -95,6 +95,7 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* svr, st_netfd_t c) realtime = SRS_PERF_MIN_LATENCY_ENABLED; send_min_interval = 0; tcp_nodelay = false; + client_type = SrsRtmpConnUnknown; _srs_config->subscribe(this); } @@ -506,6 +507,7 @@ int SrsRtmpConn::stream_service_cycle() source->source_id(), source->source_id()); source->set_cache(enabled_cache); + client_type = type; switch (type) { case SrsRtmpConnPlay: { srs_verbose("start to play stream %s.", req->stream.c_str()); @@ -828,7 +830,9 @@ int SrsRtmpConn::publishing(SrsSource* source) // use isolate thread to recv, // @see: https://github.com/ossrs/srs/issues/237 SrsPublishRecvThread trd(rtmp, req, - st_netfd_fileno(stfd), 0, this, source, true, vhost_is_edge); + st_netfd_fileno(stfd), 0, this, source, + client_type == SrsRtmpConnFMLEPublish, + vhost_is_edge); srs_info("start to publish stream %s success", req->stream.c_str()); ret = do_publishing(source, &trd); diff --git a/trunk/src/app/srs_app_rtmp_conn.hpp b/trunk/src/app/srs_app_rtmp_conn.hpp index 8690890aa7..38553f246e 100755 --- a/trunk/src/app/srs_app_rtmp_conn.hpp +++ b/trunk/src/app/srs_app_rtmp_conn.hpp @@ -33,6 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include +#include class SrsServer; class SrsRtmpServer; @@ -93,6 +94,8 @@ class SrsRtmpConn : public virtual SrsConnection, public virtual ISrsReloadHandl int publish_normal_timeout; // whether enable the tcp_nodelay. bool tcp_nodelay; + // The type of client, play or publish. + SrsRtmpConnType client_type; public: SrsRtmpConn(SrsServer* svr, st_netfd_t c); virtual ~SrsRtmpConn();