diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index a3be19727..8c11b0bc8 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -686,13 +686,15 @@ int SrsConfig::parse_file(const char* filename) // check log std::string log_filename = this->get_srs_log_file(); - if (this->get_srs_log_tank_file() && log_filename.empty()) { + if (get_srs_log_tank_file() && log_filename.empty()) { ret = ERROR_SYSTEM_CONFIG_INVALID; srs_error("must specifies the file to write log to. ret=%d", ret); return ret; } - if (!log_filename.empty()) { + if (get_srs_log_tank_file()) { srs_trace("log file is %s", log_filename.c_str()); + } else { + srs_trace("write log to console"); } return ret; diff --git a/trunk/src/app/srs_app_encoder.cpp b/trunk/src/app/srs_app_encoder.cpp index 826255742..0565140e5 100644 --- a/trunk/src/app/srs_app_encoder.cpp +++ b/trunk/src/app/srs_app_encoder.cpp @@ -569,7 +569,7 @@ int SrsEncoder::cycle() return ret; } -void SrsEncoder::on_leave_loop() +void SrsEncoder::on_thread_stop() { // kill ffmpeg when finished and it alive std::vector::iterator it; diff --git a/trunk/src/app/srs_app_encoder.hpp b/trunk/src/app/srs_app_encoder.hpp index 27cdbfc0c..0f1502dea 100644 --- a/trunk/src/app/srs_app_encoder.hpp +++ b/trunk/src/app/srs_app_encoder.hpp @@ -101,7 +101,7 @@ public: // interface ISrsThreadHandler. public: virtual int cycle(); - virtual void on_leave_loop(); + virtual void on_thread_stop(); private: virtual void clear_engines(); virtual SrsFFMPEG* at(int index); diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index 358900c5c..e3bd84082 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -126,7 +126,7 @@ int SrsListener::listen(int _port) return ret; } -void SrsListener::on_enter_loop() +void SrsListener::on_thread_start() { srs_trace("listen cycle start, port=%d, type=%d, fd=%d", port, type, fd); } diff --git a/trunk/src/app/srs_app_server.hpp b/trunk/src/app/srs_app_server.hpp index fa88b94d2..4a65c7dac 100644 --- a/trunk/src/app/srs_app_server.hpp +++ b/trunk/src/app/srs_app_server.hpp @@ -69,7 +69,7 @@ public: virtual int listen(int port); // interface ISrsThreadHandler. public: - virtual void on_enter_loop(); + virtual void on_thread_start(); virtual int cycle(); }; diff --git a/trunk/src/app/srs_app_thread.cpp b/trunk/src/app/srs_app_thread.cpp index 66a3a6827..e635324c8 100644 --- a/trunk/src/app/srs_app_thread.cpp +++ b/trunk/src/app/srs_app_thread.cpp @@ -34,7 +34,7 @@ ISrsThreadHandler::~ISrsThreadHandler() { } -void ISrsThreadHandler::on_enter_loop() +void ISrsThreadHandler::on_thread_start() { } @@ -50,7 +50,7 @@ int ISrsThreadHandler::on_end_cycle() return ret; } -void ISrsThreadHandler::on_leave_loop() +void ISrsThreadHandler::on_thread_stop() { } @@ -114,9 +114,9 @@ void SrsThread::thread_cycle() srs_assert(handler); _srs_context->generate_id(); - srs_trace("thread cycle start"); + srs_info("thread cycle start"); - handler->on_end_cycle(); + handler->on_thread_start(); loop = true; while (loop) { @@ -146,7 +146,7 @@ failed: st_usleep(cycle_interval_us); } - handler->on_leave_loop(); + handler->on_thread_stop(); srs_trace("thread cycle finished"); } diff --git a/trunk/src/app/srs_app_thread.hpp b/trunk/src/app/srs_app_thread.hpp index 140c71576..8b80cfe1f 100644 --- a/trunk/src/app/srs_app_thread.hpp +++ b/trunk/src/app/srs_app_thread.hpp @@ -34,14 +34,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /** * the handler for the thread, callback interface. * the thread model defines as: -* handler->on_enter_loop() +* handler->on_thread_start() * while loop: * handler->on_before_cycle() * handler->cycle() * handler->on_end_cycle() * if !loop then break for user stop thread. * sleep(CycleIntervalMilliseconds) -* handler->on_leave_loop() +* handler->on_thread_stop() * when stop, the thread will interrupt the st_thread, * which will cause the socket to return error and * terminate the cycle thread. @@ -69,11 +69,11 @@ public: ISrsThreadHandler(); virtual ~ISrsThreadHandler(); public: - virtual void on_enter_loop(); + virtual void on_thread_start(); virtual int on_before_cycle(); virtual int cycle() = 0; virtual int on_end_cycle(); - virtual void on_leave_loop(); + virtual void on_thread_stop(); }; /** diff --git a/trunk/src/rtmp/srs_protocol_rtmp.cpp b/trunk/src/rtmp/srs_protocol_rtmp.cpp index 5a99c7197..905b88d12 100644 --- a/trunk/src/rtmp/srs_protocol_rtmp.cpp +++ b/trunk/src/rtmp/srs_protocol_rtmp.cpp @@ -166,8 +166,8 @@ string srs_client_type_string(SrsRtmpConnType type) { switch (type) { case SrsRtmpConnPlay: return "Play"; - case SrsRtmpConnFlashPublish: return "FlashPublish"; - case SrsRtmpConnFMLEPublish: return "FMLEPublish"; + case SrsRtmpConnFlashPublish: return "publish(FlashPublish)"; + case SrsRtmpConnFMLEPublish: return "publish(FMLEPublish)"; default: return "Unknown"; } return "Unknown";