diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index 57d840dac..4750ba5ba 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -2201,11 +2201,11 @@ bool SrsConfig::get_realtime_enabled(string vhost) } conf = conf->get("min_latency"); - if (!conf || conf->arg0() != "off") { + if (!conf || conf->arg0().empty()) { return SRS_PERF_MIN_LATENCY_ENABLED; } - return false; + return conf->arg0() == "on"; } int SrsConfig::get_global_chunk_size() diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index 9817dea59..a7ce57427 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -688,14 +688,12 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsQueueRecvThread* trd) } // sendout messages, all messages are freed by send_and_free_messages(). - if (count > 0) { - // no need to assert msg, for the rtmp will assert it. - if ((ret = rtmp->send_and_free_messages(msgs.msgs, count, res->stream_id)) != ERROR_SUCCESS) { - if (!srs_is_client_gracefully_close(ret)) { - srs_error("send messages to client failed. ret=%d", ret); - } - return ret; + // no need to assert msg, for the rtmp will assert it. + if (count > 0 && (ret = rtmp->send_and_free_messages(msgs.msgs, count, res->stream_id)) != ERROR_SUCCESS) { + if (!srs_is_client_gracefully_close(ret)) { + srs_error("send messages to client failed. ret=%d", ret); } + return ret; } // if duration specified, and exceed it, stop play live. diff --git a/trunk/src/app/srs_app_source.hpp b/trunk/src/app/srs_app_source.hpp index f0607dccf..83af0ac60 100644 --- a/trunk/src/app/srs_app_source.hpp +++ b/trunk/src/app/srs_app_source.hpp @@ -237,7 +237,6 @@ public: * get packets in consumer queue. * @param msgs the msgs array to dump packets to send. * @param count the count in array, output param. - * @max_count the max count to dequeue, must be positive. */ virtual int dump_packets(SrsMessageArray* msgs, int& count); #ifdef SRS_PERF_QUEUE_COND_WAIT diff --git a/trunk/src/rtmp/srs_protocol_stack.cpp b/trunk/src/rtmp/srs_protocol_stack.cpp index 3722a7eab..02fad5d32 100644 --- a/trunk/src/rtmp/srs_protocol_stack.cpp +++ b/trunk/src/rtmp/srs_protocol_stack.cpp @@ -768,6 +768,10 @@ int SrsProtocol::do_send_messages(SrsSharedPtrMessage** msgs, int nb_msgs) // if cache is consumed, try another loop. for (int i = 0; i < nb_msgs; i++) { SrsSharedPtrMessage* msg = msgs[i]; + + if (!msg) { + continue; + } // ignore empty message. if (!msg->payload || msg->size <= 0) { @@ -1155,6 +1159,10 @@ int SrsProtocol::send_and_free_messages(SrsSharedPtrMessage** msgs, int nb_msgs, for (int i = 0; i < nb_msgs; i++) { SrsSharedPtrMessage* msg = msgs[i]; + if (!msg) { + continue; + } + // check perfer cid and stream, // when one msg stream id is ok, ignore left. if (msg->check(stream_id)) {