From 8ad934a8a430d0033c815df692b1d50dac739e59 Mon Sep 17 00:00:00 2001 From: Chengdong Zhang Date: Sat, 25 Mar 2017 12:42:37 +0800 Subject: [PATCH] srs_info use not available variable (#813) srs_info use not available variable. Variable has been removed or changed. --- trunk/src/app/srs_app_hls.cpp | 16 ++++++++-------- trunk/src/app/srs_app_mpegts_udp.cpp | 2 +- trunk/src/app/srs_app_rtmp_conn.cpp | 6 +++--- trunk/src/app/srs_app_server.cpp | 9 +++++---- trunk/src/app/srs_app_st.cpp | 8 ++++---- trunk/src/kernel/srs_kernel_codec.cpp | 8 +++++--- trunk/src/protocol/srs_protocol_utility.cpp | 2 +- 7 files changed, 27 insertions(+), 24 deletions(-) diff --git a/trunk/src/app/srs_app_hls.cpp b/trunk/src/app/srs_app_hls.cpp index 462443185..19aa79ed6 100644 --- a/trunk/src/app/srs_app_hls.cpp +++ b/trunk/src/app/srs_app_hls.cpp @@ -433,7 +433,7 @@ int SrsHlsMuxer::segment_open() srs_error("open hls muxer failed. ret=%d", ret); return ret; } - srs_info("open HLS muxer success. path=%s, tmp=%s", current->full_path.c_str(), tmp_file.c_str()); + srs_info("open HLS muxer success. path=%s, tmp=%s", current->fullpath().c_str(), tmp_file.c_str()); return ret; } @@ -463,7 +463,7 @@ bool SrsHlsMuxer::is_segment_overflow() // use N% deviation, to smoother. double deviation = hls_ts_floor? SRS_HLS_FLOOR_REAP_PERCENT * deviation_ts * hls_fragment : 0.0; srs_info("hls: dur=%.2f, tar=%.2f, dev=%.2fms/%dp, frag=%.2f", - current->duration, hls_fragment + deviation, deviation, deviation_ts, hls_fragment); + current->duration(), hls_fragment + deviation, deviation, deviation_ts, hls_fragment); return current->duration() >= (hls_fragment + deviation) * 1000; } @@ -486,7 +486,7 @@ bool SrsHlsMuxer::is_segment_absolutely_overflow() // use N% deviation, to smoother. double deviation = hls_ts_floor? SRS_HLS_FLOOR_REAP_PERCENT * deviation_ts * hls_fragment : 0.0; srs_info("hls: dur=%.2f, tar=%.2f, dev=%.2fms/%dp, frag=%.2f", - current->duration, hls_fragment + deviation, deviation, deviation_ts, hls_fragment); + current->duration(), hls_fragment + deviation, deviation, deviation_ts, hls_fragment); return current->duration() >= (hls_aof_ratio * hls_fragment + deviation) * 1000; } @@ -582,10 +582,9 @@ int SrsHlsMuxer::segment_close() if ((ret = async->execute(new SrsDvrAsyncCallOnHlsNotify(_srs_context->get_id(), req, current->uri))) != ERROR_SUCCESS) { return ret; } - - srs_info("%s reap ts segment, sequence_no=%d, uri=%s, duration=%.2f, start=%"PRId64, - log_desc.c_str(), current->sequence_no, current->uri.c_str(), current->duration, - current->segment_start_dts); + //current->start_dts is private . log_desc is removed? + srs_info("eap ts segment, sequence_no=%d, uri=%s, duration=%.2f, start=%"PRId64, + current->sequence_no, current->uri.c_str(), current->duration()); // close the muxer of finished segment. srs_freep(current->tscw); @@ -998,7 +997,8 @@ int SrsHls::cycle() { int ret = ERROR_SUCCESS; - srs_info("hls cycle for source %d", source->source_id()); + //source is removed? + //srs_info("hls cycle for source %d", source->source_id()); if (last_update_time <= 0) { last_update_time = srs_get_system_time_ms(); diff --git a/trunk/src/app/srs_app_mpegts_udp.cpp b/trunk/src/app/srs_app_mpegts_udp.cpp index e56673c40..8781b1495 100644 --- a/trunk/src/app/srs_app_mpegts_udp.cpp +++ b/trunk/src/app/srs_app_mpegts_udp.cpp @@ -410,7 +410,7 @@ int SrsMpegtsOverUdp::on_ts_video(SrsTsMessage* msg, SrsBuffer* avs) // ibp frame. // TODO: FIXME: we should group all frames to a rtmp/flv message from one ts message. - srs_info("mpegts: demux avc ibp frame size=%d, dts=%d", ibpframe_size, dts); + srs_info("mpegts: demux avc ibp frame size=%d, dts=%d", frame_size, dts); if ((ret = write_h264_ipb_frame(frame, frame_size, dts, pts)) != ERROR_SUCCESS) { return ret; } diff --git a/trunk/src/app/srs_app_rtmp_conn.cpp b/trunk/src/app/srs_app_rtmp_conn.cpp index f75cc9eef..20aad8663 100644 --- a/trunk/src/app/srs_app_rtmp_conn.cpp +++ b/trunk/src/app/srs_app_rtmp_conn.cpp @@ -383,8 +383,8 @@ int SrsRtmpConn::do_cycle() req->vhost = parsed_vhost->arg0(); } - srs_info("discovery app success. schema=%s, vhost=%s, port=%s, app=%s", - req->schema.c_str(), req->vhost.c_str(), req->port.c_str(), req->app.c_str()); + srs_info("discovery app success. schema=%s, vhost=%s, port=%d, app=%s", + req->schema.c_str(), req->vhost.c_str(), req->port, req->app.c_str()); if (req->schema.empty() || req->vhost.empty() || req->port == 0 || req->app.empty()) { ret = ERROR_RTMP_REQ_TCURL; @@ -774,7 +774,7 @@ int SrsRtmpConn::stream_service_cycle() } default: { ret = ERROR_SYSTEM_CLIENT_INVALID; - srs_info("invalid client type=%d. ret=%d", type, ret); + srs_info("invalid client type=%d. ret=%d", info->type, ret); return ret; } } diff --git a/trunk/src/app/srs_app_server.cpp b/trunk/src/app/srs_app_server.cpp index bbc283e4c..730d02a90 100644 --- a/trunk/src/app/srs_app_server.cpp +++ b/trunk/src/app/srs_app_server.cpp @@ -211,10 +211,10 @@ int SrsRtspListener::listen(string i, int p) srs_error("rtsp caster listen failed. ret=%d", ret); return ret; } - - srs_info("listen thread cid=%d, current_cid=%d, " + // pthread is removed? + srs_info("listen thread current_cid=%d, " "listen at port=%d, type=%d, fd=%d started success, ep=%s:%d", - pthread->cid(), _srs_context->get_id(), port, type, fd, ip.c_str(), port); + _srs_context->get_id(), port, type, listener->fd(), ip.c_str(), port); srs_trace("%s listen at tcp://%s:%d, fd=%d", srs_listener_type2string(type).c_str(), ip.c_str(), port, listener->fd()); @@ -274,9 +274,10 @@ int SrsHttpFlvListener::listen(string i, int p) return ret; } + // pthread is removed? srs_info("listen thread cid=%d, current_cid=%d, " "listen at port=%d, type=%d, fd=%d started success, ep=%s:%d", - pthread->cid(), _srs_context->get_id(), port, type, fd, ip.c_str(), port); + _srs_context->get_id(), port, type, listener->fd(), ip.c_str(), port); srs_trace("%s listen at tcp://%s:%d, fd=%d", srs_listener_type2string(type).c_str(), ip.c_str(), port, listener->fd()); diff --git a/trunk/src/app/srs_app_st.cpp b/trunk/src/app/srs_app_st.cpp index af0a45e21..5bc2e925c 100755 --- a/trunk/src/app/srs_app_st.cpp +++ b/trunk/src/app/srs_app_st.cpp @@ -88,7 +88,7 @@ namespace internal int ret = ERROR_SUCCESS; if(trd) { - srs_info("thread %s already running.", _name); + srs_info("thread %s already running.", name); return ret; } @@ -155,7 +155,7 @@ namespace internal srs_warn("thread %s on before cycle failed, ignored and retry, ret=%d", name, ret); goto failed; } - srs_info("thread %s on before cycle success", _name); + srs_info("thread %s on before cycle success", name); if ((ret = handler->cycle()) != ERROR_SUCCESS) { if (!srs_is_client_gracefully_close(ret) && !srs_is_system_control_error(ret)) { @@ -163,13 +163,13 @@ namespace internal } goto failed; } - srs_info("thread %s cycle success", _name); + srs_info("thread %s cycle success", name); if ((ret = handler->on_end_cycle()) != ERROR_SUCCESS) { srs_warn("thread %s on end cycle failed, ignored and retry, ret=%d", name, ret); goto failed; } - srs_info("thread %s on end cycle success", _name); + srs_info("thread %s on end cycle success", name); failed: if (!loop) { diff --git a/trunk/src/kernel/srs_kernel_codec.cpp b/trunk/src/kernel/srs_kernel_codec.cpp index 53331c9aa..9cf3aeef7 100644 --- a/trunk/src/kernel/srs_kernel_codec.cpp +++ b/trunk/src/kernel/srs_kernel_codec.cpp @@ -713,8 +713,9 @@ int SrsFormat::video_avc_demux(SrsBuffer* stream, int64_t timestamp) // ignored. } + int size = stream->size() - stream->pos(); srs_info("avc decoded, type=%d, codec=%d, avc=%d, cts=%d, size=%d", - frame_type, video_codec_id, avc_packet_type, composition_time, size); + frame_type, codec_id, avc_packet_type, composition_time,size); return ret; } @@ -1348,7 +1349,7 @@ int SrsFormat::audio_aac_demux(SrsBuffer* stream, int64_t timestamp) break; }; } - + int size = stream->size() - stream->pos(); srs_info("aac decoded, type=%d, codec=%d, asize=%d, rate=%d, format=%d, size=%d", sound_type, codec_id, sound_size, sound_rate, sound_format, size); @@ -1394,8 +1395,9 @@ int SrsFormat::audio_mp3_demux(SrsBuffer* stream, int64_t timestamp) return ret; } + // format is sound_format? srs_info("audio decoded, type=%d, codec=%d, asize=%d, rate=%d, format=%d, size=%d", - acodec->sound_type, acodec->id, acodec->sound_size, acodec->sound_rate, acodec->acodec, size); + acodec->sound_type, acodec->id, acodec->sound_size, acodec->sound_rate, sound_format, size); return ret; } diff --git a/trunk/src/protocol/srs_protocol_utility.cpp b/trunk/src/protocol/srs_protocol_utility.cpp index e7878b054..b3ac46cfa 100644 --- a/trunk/src/protocol/srs_protocol_utility.cpp +++ b/trunk/src/protocol/srs_protocol_utility.cpp @@ -104,7 +104,7 @@ void srs_discovery_tc_url( port = SRS_CONSTS_RTMP_DEFAULT_PORT; if ((pos = host.find(":")) != std::string::npos) { srs_parse_hostport(host, host, port); - srs_info("discovery host=%s, port=%s", host.c_str(), port.c_str()); + srs_info("discovery host=%s, port=%d", host.c_str(), port); } if (url.empty()) {