From a2d9f0a9ad03b22ca35a022264e6c345b2669829 Mon Sep 17 00:00:00 2001 From: winlin Date: Thu, 20 Aug 2020 18:22:36 +0800 Subject: [PATCH] Fix bug --- trunk/src/app/srs_app_config.cpp | 2 +- trunk/src/app/srs_app_dash.cpp | 1 + trunk/src/app/srs_app_dvr.cpp | 1 + trunk/src/app/srs_app_http_static.cpp | 4 ++-- trunk/src/app/srs_app_rtmp_conn.cpp | 3 +++ trunk/src/kernel/srs_kernel_mp4.cpp | 2 +- trunk/src/main/srs_main_ingest_hls.cpp | 1 + trunk/src/protocol/srs_http_stack.cpp | 2 +- trunk/src/protocol/srs_service_http_conn.cpp | 3 ++- 9 files changed, 13 insertions(+), 6 deletions(-) diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index b790be70b..b226c8cbe 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -3662,7 +3662,7 @@ srs_error_t SrsConfig::check_normal_config() for (int i = 0; i < (int)listens.size(); i++) { string port = listens[i]; if (port.empty() || ::atoi(port.c_str()) <= 0) { - return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "listen.port=%d is invalid", port.c_str()); + return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "listen.port=%s is invalid", port.c_str()); } } } diff --git a/trunk/src/app/srs_app_dash.cpp b/trunk/src/app/srs_app_dash.cpp index 40e9a9c53..bf67014be 100644 --- a/trunk/src/app/srs_app_dash.cpp +++ b/trunk/src/app/srs_app_dash.cpp @@ -307,6 +307,7 @@ SrsDashController::SrsDashController() vfragments = new SrsFragmentWindow(); afragments = new SrsFragmentWindow(); audio_dts = video_dts = 0; + fragment = 0; } SrsDashController::~SrsDashController() diff --git a/trunk/src/app/srs_app_dvr.cpp b/trunk/src/app/srs_app_dvr.cpp index 2665210a1..9a3af4ef1 100644 --- a/trunk/src/app/srs_app_dvr.cpp +++ b/trunk/src/app/srs_app_dvr.cpp @@ -585,6 +585,7 @@ string SrsDvrAsyncCallOnDvr::to_string() SrsDvrPlan::SrsDvrPlan() { req = NULL; + hub = NULL; dvr_enabled = false; segment = NULL; diff --git a/trunk/src/app/srs_app_http_static.cpp b/trunk/src/app/srs_app_http_static.cpp index 04724bdab..a20fea72f 100644 --- a/trunk/src/app/srs_app_http_static.cpp +++ b/trunk/src/app/srs_app_http_static.cpp @@ -134,7 +134,7 @@ srs_error_t SrsVodStream::serve_flv_stream(ISrsHttpResponseWriter* w, ISrsHttpMe // send data if ((err = copy(w, fs, r, (int)left)) != srs_success) { - return srs_error_wrap(err, "read flv=%s size=%d", fullpath.c_str(), left); + return srs_error_wrap(err, "read flv=%s size=%d", fullpath.c_str(), (int)left); } return err; @@ -184,7 +184,7 @@ srs_error_t SrsVodStream::serve_mp4_stream(ISrsHttpResponseWriter* w, ISrsHttpMe // send data if ((err = copy(w, fs, r, (int)left)) != srs_success) { - return srs_error_wrap(err, "read mp4=%s size=%d", fullpath.c_str(), left); + return srs_error_wrap(err, "read mp4=%s size=%d", fullpath.c_str(), (int)left); } return err; diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index d46ed99db..27e6d2e4f 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -121,6 +121,9 @@ SrsRtmpConn::SrsRtmpConn(SrsServer* svr, srs_netfd_t c, string cip, int port) : send_min_interval = 0; tcp_nodelay = false; info = new SrsClientInfo(); + + publish_1stpkt_timeout = 0; + publish_normal_timeout = 0; _srs_config->subscribe(this); } diff --git a/trunk/src/kernel/srs_kernel_mp4.cpp b/trunk/src/kernel/srs_kernel_mp4.cpp index d943b6c4c..f72d258f2 100644 --- a/trunk/src/kernel/srs_kernel_mp4.cpp +++ b/trunk/src/kernel/srs_kernel_mp4.cpp @@ -5217,7 +5217,7 @@ srs_error_t SrsMp4BoxReader::read(SrsSimpleStream* stream, SrsMp4Box** ppbox) while (stream->length() < (int)required) { ssize_t nread; if ((err = rsio->read(buf, SRS_MP4_BUF_SIZE, &nread)) != srs_success) { - return srs_error_wrap(err, "load failed, nread=%d, required=%d", nread, required); + return srs_error_wrap(err, "load failed, nread=%d, required=%d", (int)nread, required); } srs_assert(nread > 0); diff --git a/trunk/src/main/srs_main_ingest_hls.cpp b/trunk/src/main/srs_main_ingest_hls.cpp index 29b928a61..91895f422 100644 --- a/trunk/src/main/srs_main_ingest_hls.cpp +++ b/trunk/src/main/srs_main_ingest_hls.cpp @@ -147,6 +147,7 @@ private: skip = false; sent = false; dirty = false; + duration = 0.0; } int fetch(std::string m3u8); diff --git a/trunk/src/protocol/srs_http_stack.cpp b/trunk/src/protocol/srs_http_stack.cpp index b34825b79..904ad419a 100644 --- a/trunk/src/protocol/srs_http_stack.cpp +++ b/trunk/src/protocol/srs_http_stack.cpp @@ -457,7 +457,7 @@ srs_error_t SrsHttpFileServer::serve_file(ISrsHttpResponseWriter* w, ISrsHttpMes // write body. int64_t left = length; if ((err = copy(w, fs, r, (int)left)) != srs_success) { - return srs_error_wrap(err, "copy file=%s size=%d", fullpath.c_str(), left); + return srs_error_wrap(err, "copy file=%s size=%d", fullpath.c_str(), (int)left); } if ((err = w->final_request()) != srs_success) { diff --git a/trunk/src/protocol/srs_service_http_conn.cpp b/trunk/src/protocol/srs_service_http_conn.cpp index aa62b425f..f96bae831 100644 --- a/trunk/src/protocol/srs_service_http_conn.cpp +++ b/trunk/src/protocol/srs_service_http_conn.cpp @@ -139,7 +139,7 @@ srs_error_t SrsHttpParser::parse_message_imp(ISrsReader* reader) enum http_errno code; if ((code = HTTP_PARSER_ERRNO(&parser)) != HPE_OK) { return srs_error_new(ERROR_HTTP_PARSE_HEADER, "parse %dB, nparsed=%d, err=%d/%s %s", - buffer->size(), consumed, code, http_errno_name(code), http_errno_description(code)); + buffer->size(), (int)consumed, code, http_errno_name(code), http_errno_description(code)); } // When buffer consumed these bytes, it's dropped so the new ptr is actually the HTTP body. But http-parser @@ -940,6 +940,7 @@ SrsHttpResponseReader::SrsHttpResponseReader(SrsHttpMessage* msg, ISrsReader* re nb_total_read = 0; nb_left_chunk = 0; buffer = body; + nb_chunk = 0; } SrsHttpResponseReader::~SrsHttpResponseReader()