1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Remove warning: C++11 requires a space between string literal and macro (#874)

On Ubuntu 17.04, the default gcc compiler version is 6.3.0.
It switch standard from c++98 to c++11.
So it would generate verbose warnings.
This commit is contained in:
HungMingWu 2017-05-06 14:05:22 +08:00 committed by winlin
parent a58874178b
commit 815d50f00a
32 changed files with 114 additions and 114 deletions

View file

@ -156,7 +156,7 @@ int SrsBandwidth::bandwidth_check(SrsRtmpServer* rtmp, ISrsProtocolStatistic* io
if (last_check_time > 0 && time_now - last_check_time < interval_ms) { if (last_check_time > 0 && time_now - last_check_time < interval_ms) {
ret = ERROR_SYSTEM_BANDWIDTH_DENIED; ret = ERROR_SYSTEM_BANDWIDTH_DENIED;
srs_trace("reject, " srs_trace("reject, "
"last_check=%"PRId64", now=%"PRId64", interval=%d", "last_check=%" PRId64 ", now=%" PRId64 ", interval=%d",
last_check_time, time_now, interval_ms); last_check_time, time_now, interval_ms);
_rtmp->response_connect_reject(_req, "bandcheck rejected"); _rtmp->response_connect_reject(_req, "bandcheck rejected");

View file

@ -195,7 +195,7 @@ int SrsDynamicHttpConn::do_proxy(ISrsHttpResponseReader* rr, SrsFlvDecoder* dec)
sdk = new SrsSimpleRtmpClient(output, cto, sto); sdk = new SrsSimpleRtmpClient(output, cto, sto);
if ((ret = sdk->connect()) != ERROR_SUCCESS) { if ((ret = sdk->connect()) != ERROR_SUCCESS) {
srs_error("flv: connect %s failed, cto=%"PRId64", sto=%"PRId64". ret=%d", output.c_str(), cto, sto, ret); srs_error("flv: connect %s failed, cto=%" PRId64 ", sto=%" PRId64 ". ret=%d", output.c_str(), cto, sto, ret);
return ret; return ret;
} }

View file

@ -56,7 +56,7 @@ using namespace std;
using namespace _srs_internal; using namespace _srs_internal;
// @global the version to identify the core. // @global the version to identify the core.
const char* _srs_version = "XCORE-"RTMP_SIG_SRS_SERVER; const char* _srs_version = "XCORE-" RTMP_SIG_SRS_SERVER;
#define SRS_WIKI_URL_LOG "https://github.com/ossrs/srs/wiki/v1_CN_SrsLog" #define SRS_WIKI_URL_LOG "https://github.com/ossrs/srs/wiki/v1_CN_SrsLog"
@ -3488,12 +3488,12 @@ int SrsConfig::parse_argv(int& i, char** argv)
void SrsConfig::print_help(char** argv) void SrsConfig::print_help(char** argv)
{ {
printf( printf(
RTMP_SIG_SRS_SERVER" "RTMP_SIG_SRS_COPYRIGHT"\n" RTMP_SIG_SRS_SERVER " " RTMP_SIG_SRS_COPYRIGHT "\n"
"License: "RTMP_SIG_SRS_LICENSE"\n" "License: " RTMP_SIG_SRS_LICENSE "\n"
"Primary: "RTMP_SIG_SRS_PRIMARY"\n" "Primary: " RTMP_SIG_SRS_PRIMARY "\n"
"Authors: "RTMP_SIG_SRS_AUTHROS"\n" "Authors: " RTMP_SIG_SRS_AUTHROS "\n"
"Build: "SRS_AUTO_BUILD_DATE" Configuration:"SRS_AUTO_USER_CONFIGURE"\n" "Build: " SRS_AUTO_BUILD_DATE " Configuration:" SRS_AUTO_USER_CONFIGURE "\n"
"Features:"SRS_AUTO_CONFIGURE"\n""\n" "Features:" SRS_AUTO_CONFIGURE "\n""\n"
"Usage: %s [-h?vVsS] [[-t] -c <filename>]\n" "Usage: %s [-h?vVsS] [[-t] -c <filename>]\n"
"\n" "\n"
"Options:\n" "Options:\n"
@ -3506,14 +3506,14 @@ void SrsConfig::print_help(char** argv)
" -p rtmp-port : the rtmp port to listen.\n" " -p rtmp-port : the rtmp port to listen.\n"
" -x http-port : the http port to listen.\n" " -x http-port : the http port to listen.\n"
"\n" "\n"
RTMP_SIG_SRS_WEB"\n" RTMP_SIG_SRS_WEB "\n"
RTMP_SIG_SRS_URL"\n" RTMP_SIG_SRS_URL "\n"
"Email: "RTMP_SIG_SRS_EMAIL"\n" "Email: " RTMP_SIG_SRS_EMAIL "\n"
"\n" "\n"
"For example:\n" "For example:\n"
" %s -v\n" " %s -v\n"
" %s -t -c "SRS_CONF_DEFAULT_COFNIG_FILE"\n" " %s -t -c " SRS_CONF_DEFAULT_COFNIG_FILE "\n"
" %s -c "SRS_CONF_DEFAULT_COFNIG_FILE"\n", " %s -c " SRS_CONF_DEFAULT_COFNIG_FILE "\n",
argv[0], argv[0], argv[0], argv[0]); argv[0], argv[0], argv[0], argv[0]);
} }
@ -3679,7 +3679,7 @@ int SrsConfig::check_normal_config()
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
if (get_heartbeat_interval() <= 0) { if (get_heartbeat_interval() <= 0) {
ret = ERROR_SYSTEM_CONFIG_INVALID; ret = ERROR_SYSTEM_CONFIG_INVALID;
srs_error("directive heartbeat interval invalid, interval=%"PRId64", ret=%d", srs_error("directive heartbeat interval invalid, interval=%" PRId64 ", ret=%d",
get_heartbeat_interval(), ret); get_heartbeat_interval(), ret);
return ret; return ret;
} }
@ -6992,7 +6992,7 @@ int64_t SrsConfig::get_heartbeat_interval()
string SrsConfig::get_heartbeat_url() string SrsConfig::get_heartbeat_url()
{ {
static string DEFAULT = "http://"SRS_CONSTS_LOCALHOST":8085/api/v1/servers"; static string DEFAULT = "http://" SRS_CONSTS_LOCALHOST ":8085/api/v1/servers";
SrsConfDirective* conf = get_heartbeart(); SrsConfDirective* conf = get_heartbeart();
if (!conf) { if (!conf) {

View file

@ -127,7 +127,7 @@ int SrsEdgeRtmpUpstream::connect(SrsRequest* r, SrsLbRoundRobin* lb)
sdk = new SrsSimpleRtmpClient(url, cto, sto); sdk = new SrsSimpleRtmpClient(url, cto, sto);
if ((ret = sdk->connect()) != ERROR_SUCCESS) { if ((ret = sdk->connect()) != ERROR_SUCCESS) {
srs_error("edge pull %s failed, cto=%"PRId64", sto=%"PRId64". ret=%d", url.c_str(), cto, sto, ret); srs_error("edge pull %s failed, cto=%" PRId64 ", sto=%" PRId64 ". ret=%d", url.c_str(), cto, sto, ret);
return ret; return ret;
} }
@ -469,7 +469,7 @@ int SrsEdgeForwarder::start()
sdk = new SrsSimpleRtmpClient(url, cto, sto); sdk = new SrsSimpleRtmpClient(url, cto, sto);
if ((ret = sdk->connect()) != ERROR_SUCCESS) { if ((ret = sdk->connect()) != ERROR_SUCCESS) {
srs_warn("edge push %s failed, cto=%"PRId64", sto=%"PRId64". ret=%d", url.c_str(), cto, sto, ret); srs_warn("edge push %s failed, cto=%" PRId64 ", sto=%" PRId64 ". ret=%d", url.c_str(), cto, sto, ret);
return ret; return ret;
} }

View file

@ -333,7 +333,7 @@ void SrsEncoder::show_encode_log_message()
// reportable // reportable
if (pprint->can_print()) { if (pprint->can_print()) {
// TODO: FIXME: show more info. // TODO: FIXME: show more info.
srs_trace("-> "SRS_CONSTS_LOG_ENCODER" time=%"PRId64", encoders=%d, input=%s", srs_trace("-> " SRS_CONSTS_LOG_ENCODER " time=%" PRId64 ", encoders=%d, input=%s",
pprint->age(), (int)ffmpegs.size(), input_stream_name.c_str()); pprint->age(), (int)ffmpegs.size(), input_stream_name.c_str());
} }
} }

View file

@ -242,7 +242,7 @@ int SrsForwarder::cycle()
sdk = new SrsSimpleRtmpClient(url, cto, sto); sdk = new SrsSimpleRtmpClient(url, cto, sto);
if ((ret = sdk->connect()) != ERROR_SUCCESS) { if ((ret = sdk->connect()) != ERROR_SUCCESS) {
srs_warn("forward failed, url=%s, cto=%"PRId64", sto=%"PRId64". ret=%d", url.c_str(), cto, sto, ret); srs_warn("forward failed, url=%s, cto=%" PRId64 ", sto=%" PRId64 ". ret=%d", url.c_str(), cto, sto, ret);
return ret; return ret;
} }

View file

@ -369,7 +369,7 @@ int SrsHlsMuxer::segment_open()
// jump when deviation more than 10p // jump when deviation more than 10p
if (accept_floor_ts - current_floor_ts > SRS_JUMP_WHEN_PIECE_DEVIATION) { if (accept_floor_ts - current_floor_ts > SRS_JUMP_WHEN_PIECE_DEVIATION) {
srs_warn("hls: jmp for ts deviation, current=%"PRId64", accept=%"PRId64, current_floor_ts, accept_floor_ts); srs_warn("hls: jmp for ts deviation, current=%" PRId64 ", accept=%" PRId64, current_floor_ts, accept_floor_ts);
accept_floor_ts = current_floor_ts - 1; accept_floor_ts = current_floor_ts - 1;
} }
@ -378,7 +378,7 @@ int SrsHlsMuxer::segment_open()
// dup/jmp detect for ts in floor mode. // dup/jmp detect for ts in floor mode.
if (previous_floor_ts && previous_floor_ts != current_floor_ts - 1) { if (previous_floor_ts && previous_floor_ts != current_floor_ts - 1) {
srs_warn("hls: dup/jmp ts, previous=%"PRId64", current=%"PRId64", accept=%"PRId64", deviation=%d", srs_warn("hls: dup/jmp ts, previous=%" PRId64 ", current=%" PRId64 ", accept=%" PRId64 ", deviation=%d",
previous_floor_ts, current_floor_ts, accept_floor_ts, deviation_ts); previous_floor_ts, current_floor_ts, accept_floor_ts, deviation_ts);
} }
previous_floor_ts = current_floor_ts; previous_floor_ts = current_floor_ts;
@ -462,7 +462,7 @@ bool SrsHlsMuxer::is_segment_overflow()
// use N% deviation, to smoother. // use N% deviation, to smoother.
double deviation = hls_ts_floor? SRS_HLS_FLOOR_REAP_PERCENT * deviation_ts * hls_fragment : 0.0; double deviation = hls_ts_floor? SRS_HLS_FLOOR_REAP_PERCENT * deviation_ts * hls_fragment : 0.0;
srs_info("hls: dur=%"PRId64"ms, tar=%.2f, dev=%.2fms/%dp, frag=%.2f", srs_info("hls: dur=%" PRId64 "ms, 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; return current->duration() >= (hls_fragment + deviation) * 1000;
@ -485,7 +485,7 @@ bool SrsHlsMuxer::is_segment_absolutely_overflow()
// use N% deviation, to smoother. // use N% deviation, to smoother.
double deviation = hls_ts_floor? SRS_HLS_FLOOR_REAP_PERCENT * deviation_ts * hls_fragment : 0.0; double deviation = hls_ts_floor? SRS_HLS_FLOOR_REAP_PERCENT * deviation_ts * hls_fragment : 0.0;
srs_info("hls: dur=%"PRId64"ms, tar=%.2f, dev=%.2fms/%dp, frag=%.2f", srs_info("hls: dur=%" PRId64 "ms, 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; return current->duration() >= (hls_aof_ratio * hls_fragment + deviation) * 1000;
@ -582,7 +582,7 @@ int SrsHlsMuxer::segment_close()
if ((ret = async->execute(new SrsDvrAsyncCallOnHlsNotify(_srs_context->get_id(), req, current->uri))) != ERROR_SUCCESS) { if ((ret = async->execute(new SrsDvrAsyncCallOnHlsNotify(_srs_context->get_id(), req, current->uri))) != ERROR_SUCCESS) {
return ret; return ret;
} }
srs_info("Reap ts segment, sequence_no=%d, uri=%s, duration=%"PRId64"ms", current->sequence_no, current->uri.c_str(), current->duration()); srs_info("Reap ts segment, sequence_no=%d, uri=%s, duration=%" PRId64 "ms", current->sequence_no, current->uri.c_str(), current->duration());
// close the muxer of finished segment. // close the muxer of finished segment.
srs_freep(current->tscw); srs_freep(current->tscw);
@ -598,7 +598,7 @@ int SrsHlsMuxer::segment_close()
// reuse current segment index. // reuse current segment index.
_sequence_no--; _sequence_no--;
srs_trace("Drop ts segment, sequence_no=%d, uri=%s, duration=%"PRId64"ms", current->sequence_no, current->uri.c_str(), current->duration()); srs_trace("Drop ts segment, sequence_no=%d, uri=%s, duration=%" PRId64 "ms", current->sequence_no, current->uri.c_str(), current->duration());
// rename from tmp to real path // rename from tmp to real path
if ((ret = current->unlink_tmpfile()) != ERROR_SUCCESS) { if ((ret = current->unlink_tmpfile()) != ERROR_SUCCESS) {
@ -1211,7 +1211,7 @@ void SrsHls::hls_show_mux_log()
// the run time is not equals to stream time, // the run time is not equals to stream time,
// @see: https://github.com/ossrs/srs/issues/81#issuecomment-48100994 // @see: https://github.com/ossrs/srs/issues/81#issuecomment-48100994
// it's ok. // it's ok.
srs_trace("-> "SRS_CONSTS_LOG_HLS" time=%"PRId64", sno=%d, ts=%s, dur=%.2f, dva=%dp", srs_trace("-> " SRS_CONSTS_LOG_HLS " time=%" PRId64 ", sno=%d, ts=%s, dur=%.2f, dva=%dp",
pprint->age(), controller->sequence_no(), controller->ts_url().c_str(), pprint->age(), controller->sequence_no(), controller->ts_url().c_str(),
controller->duration(), controller->deviation()); controller->duration(), controller->deviation());
} }

View file

@ -1399,7 +1399,7 @@ int SrsHttpApi::process_request(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
SrsHttpMessage* hm = dynamic_cast<SrsHttpMessage*>(r); SrsHttpMessage* hm = dynamic_cast<SrsHttpMessage*>(r);
srs_assert(hm); srs_assert(hm);
srs_trace("HTTP API %s %s, content-length=%"PRId64", chunked=%d/%d", srs_trace("HTTP API %s %s, content-length=%" PRId64 ", chunked=%d/%d",
r->method_str().c_str(), r->url().c_str(), r->content_length(), r->method_str().c_str(), r->url().c_str(), r->content_length(),
hm->is_chunked(), hm->is_infinite_chunked()); hm->is_chunked(), hm->is_infinite_chunked());

View file

@ -170,7 +170,7 @@ int SrsHttpConn::process_request(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
srs_trace("HTTP %s %s, content-length=%"PRId64"", srs_trace("HTTP %s %s, content-length=%" PRId64 "",
r->method_str().c_str(), r->url().c_str(), r->content_length()); r->method_str().c_str(), r->url().c_str(), r->content_length());
// use cors server mux to serve http request, which will proxy to http_remux. // use cors server mux to serve http request, which will proxy to http_remux.

View file

@ -73,7 +73,7 @@ int SrsVodStream::serve_flv_stream(ISrsHttpResponseWriter* w, ISrsHttpMessage* r
if (offset > fs.filesize()) { if (offset > fs.filesize()) {
ret = ERROR_HTTP_REMUX_OFFSET_OVERFLOW; ret = ERROR_HTTP_REMUX_OFFSET_OVERFLOW;
srs_warn("http flv streaming %s overflow. size=%"PRId64", offset=%d, ret=%d", srs_warn("http flv streaming %s overflow. size=%" PRId64 ", offset=%d, ret=%d",
fullpath.c_str(), fs.filesize(), offset, ret); fullpath.c_str(), fs.filesize(), offset, ret);
return ret; return ret;
} }
@ -165,7 +165,7 @@ int SrsVodStream::serve_mp4_stream(ISrsHttpResponseWriter* w, ISrsHttpMessage* r
if (end > fs.filesize() || start > end) { if (end > fs.filesize() || start > end) {
ret = ERROR_HTTP_REMUX_OFFSET_OVERFLOW; ret = ERROR_HTTP_REMUX_OFFSET_OVERFLOW;
srs_warn("http mp4 streaming %s overflow. size=%"PRId64", offset=%d, ret=%d", srs_warn("http mp4 streaming %s overflow. size=%" PRId64 ", offset=%d, ret=%d",
fullpath.c_str(), fs.filesize(), start, ret); fullpath.c_str(), fs.filesize(), start, ret);
return ret; return ret;
} }

View file

@ -159,7 +159,7 @@ int SrsBufferCache::cycle()
} }
if (pprint->can_print()) { if (pprint->can_print()) {
srs_trace("-> "SRS_CONSTS_LOG_HTTP_STREAM_CACHE" http: got %d msgs, age=%d, min=%d, mw=%d", srs_trace("-> " SRS_CONSTS_LOG_HTTP_STREAM_CACHE " http: got %d msgs, age=%d, min=%d, mw=%d",
count, pprint->age(), SRS_PERF_MW_MIN_MSGS, SRS_CONSTS_RTMP_PULSE_TMMS); count, pprint->age(), SRS_PERF_MW_MIN_MSGS, SRS_CONSTS_RTMP_PULSE_TMMS);
} }
@ -579,7 +579,7 @@ int SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
} }
if (pprint->can_print()) { if (pprint->can_print()) {
srs_info("-> "SRS_CONSTS_LOG_HTTP_STREAM" http: got %d msgs, age=%d, min=%d, mw=%d", srs_info("-> " SRS_CONSTS_LOG_HTTP_STREAM " http: got %d msgs, age=%d, min=%d, mw=%d",
count, pprint->age(), SRS_PERF_MW_MIN_MSGS, SRS_CONSTS_RTMP_PULSE_TMMS); count, pprint->age(), SRS_PERF_MW_MIN_MSGS, SRS_CONSTS_RTMP_PULSE_TMMS);
} }

View file

@ -462,7 +462,7 @@ void SrsIngester::show_ingest_log_message()
// reportable // reportable
if (pprint->can_print()) { if (pprint->can_print()) {
srs_trace("-> "SRS_CONSTS_LOG_INGESTER" time=%"PRId64", ingesters=%d, #%d(alive=%ds, %s)", srs_trace("-> " SRS_CONSTS_LOG_INGESTER " time=%" PRId64 ", ingesters=%d, #%d(alive=%ds, %s)",
pprint->age(), (int)ingesters.size(), index, ingester->alive() / 1000, ingester->uri().c_str()); pprint->age(), (int)ingesters.size(), index, ingester->alive() / 1000, ingester->uri().c_str());
} }
} }

View file

@ -81,7 +81,7 @@ int SrsMpegtsQueue::push(SrsSharedPtrMessage* msg)
msg->timestamp += 1; msg->timestamp += 1;
if (i >= 5) { if (i >= 5) {
srs_warn("mpegts: free the msg for dts exists, dts=%"PRId64, msg->timestamp); srs_warn("mpegts: free the msg for dts exists, dts=%" PRId64, msg->timestamp);
srs_freep(msg); srs_freep(msg);
return ret; return ret;
} }
@ -293,7 +293,7 @@ int SrsMpegtsOverUdp::on_ts_message(SrsTsMessage* msg)
// ((stream_id >> 4) & 0x0f) == SrsTsPESStreamIdVideo // ((stream_id >> 4) & 0x0f) == SrsTsPESStreamIdVideo
if (pprint->can_print()) { if (pprint->can_print()) {
srs_trace("<- "SRS_CONSTS_LOG_STREAM_CASTER" mpegts: got %s age=%d stream=%s, dts=%"PRId64", pts=%"PRId64", size=%d, us=%d, cc=%d, sid=%#x(%s-%d)", srs_trace("<- " SRS_CONSTS_LOG_STREAM_CASTER " mpegts: got %s age=%d stream=%s, dts=%" PRId64 ", pts=%" PRId64 ", size=%d, us=%d, cc=%d, sid=%#x(%s-%d)",
(msg->channel->apply == SrsTsPidApplyVideo)? "Video":"Audio", pprint->age(), srs_ts_stream2string(msg->channel->stream).c_str(), (msg->channel->apply == SrsTsPidApplyVideo)? "Video":"Audio", pprint->age(), srs_ts_stream2string(msg->channel->stream).c_str(),
msg->dts, msg->pts, msg->payload->length(), msg->packet->payload_unit_start_indicator, msg->continuity_counter, msg->sid, msg->dts, msg->pts, msg->payload->length(), msg->packet->payload_unit_start_indicator, msg->continuity_counter, msg->sid,
msg->is_audio()? "A":msg->is_video()? "V":"N", msg->stream_number()); msg->is_audio()? "A":msg->is_video()? "V":"N", msg->stream_number());
@ -593,7 +593,7 @@ int SrsMpegtsOverUdp::rtmp_write_packet(char type, uint32_t timestamp, char* dat
} }
if (pprint->can_print()) { if (pprint->can_print()) {
srs_trace("mpegts: send msg %s age=%d, dts=%"PRId64", size=%d", srs_trace("mpegts: send msg %s age=%d, dts=%" PRId64 ", size=%d",
msg->is_audio()? "A":msg->is_video()? "V":"N", pprint->age(), msg->timestamp, msg->size); msg->is_audio()? "A":msg->is_video()? "V":"N", pprint->age(), msg->timestamp, msg->size);
} }
@ -622,7 +622,7 @@ int SrsMpegtsOverUdp::connect()
if ((ret = sdk->connect()) != ERROR_SUCCESS) { if ((ret = sdk->connect()) != ERROR_SUCCESS) {
close(); close();
srs_error("mpegts: connect %s failed, cto=%"PRId64", sto=%"PRId64". ret=%d", output.c_str(), cto, sto, ret); srs_error("mpegts: connect %s failed, cto=%" PRId64 ", sto=%" PRId64 ". ret=%d", output.c_str(), cto, sto, ret);
return ret; return ret;
} }

View file

@ -188,7 +188,7 @@ void SrsNgExec::show_exec_log_message()
// reportable // reportable
if (pprint->can_print()) { if (pprint->can_print()) {
// TODO: FIXME: show more info. // TODO: FIXME: show more info.
srs_trace("-> "SRS_CONSTS_LOG_EXEC" time=%"PRId64", publish=%d, input=%s", srs_trace("-> " SRS_CONSTS_LOG_EXEC " time=%" PRId64 ", publish=%d, input=%s",
pprint->age(), (int)exec_publishs.size(), input_stream_name.c_str()); pprint->age(), (int)exec_publishs.size(), input_stream_name.c_str());
} }
} }

View file

@ -354,7 +354,7 @@ int SrsPublishRecvThread::consume(SrsCommonMessage* msg)
} }
// log to show the time of recv thread. // log to show the time of recv thread.
srs_verbose("recv thread now=%"PRId64"us, got msg time=%"PRId64"ms, size=%d", srs_verbose("recv thread now=%" PRId64 "us, got msg time=%" PRId64 "ms, size=%d",
srs_update_system_time_ms(), msg->header.timestamp, msg->size); srs_update_system_time_ms(), msg->header.timestamp, msg->size);
// the rtmp connection will handle this message // the rtmp connection will handle this message

View file

@ -766,7 +766,7 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsConsumer* consumer, SrsQueueRe
#ifdef SRS_PERF_QUEUE_COND_WAIT #ifdef SRS_PERF_QUEUE_COND_WAIT
// for send wait time debug // for send wait time debug
srs_verbose("send thread now=%"PRId64"us, wait %dms", srs_update_system_time_ms(), mw_sleep); srs_verbose("send thread now=%" PRId64 "us, wait %dms", srs_update_system_time_ms(), mw_sleep);
// wait for message to incoming. // wait for message to incoming.
// @see https://github.com/ossrs/srs/issues/251 // @see https://github.com/ossrs/srs/issues/251
@ -780,7 +780,7 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsConsumer* consumer, SrsQueueRe
} }
// for send wait time debug // for send wait time debug
srs_verbose("send thread now=%"PRId64"us wakeup", srs_update_system_time_ms()); srs_verbose("send thread now=%" PRId64 "us wakeup", srs_update_system_time_ms());
#endif #endif
// get messages from consumer. // get messages from consumer.
@ -795,8 +795,8 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsConsumer* consumer, SrsQueueRe
// reportable // reportable
if (pprint->can_print()) { if (pprint->can_print()) {
kbps->sample(); kbps->sample();
srs_trace("-> "SRS_CONSTS_LOG_PLAY srs_trace("-> " SRS_CONSTS_LOG_PLAY
" time=%"PRId64", msgs=%d, okbps=%d,%d,%d, ikbps=%d,%d,%d, mw=%d", " time=%" PRId64 ", msgs=%d, okbps=%d,%d,%d, ikbps=%d,%d,%d, mw=%d",
pprint->age(), count, pprint->age(), count,
kbps->get_send_kbps(), kbps->get_send_kbps_30s(), kbps->get_send_kbps_5m(), kbps->get_send_kbps(), kbps->get_send_kbps_30s(), kbps->get_send_kbps_5m(),
kbps->get_recv_kbps(), kbps->get_recv_kbps_30s(), kbps->get_recv_kbps_5m(), kbps->get_recv_kbps(), kbps->get_recv_kbps_30s(), kbps->get_recv_kbps_5m(),
@ -808,7 +808,7 @@ int SrsRtmpConn::do_playing(SrsSource* source, SrsConsumer* consumer, SrsQueueRe
// for min latency event no message incoming, // for min latency event no message incoming,
// so the count maybe zero. // so the count maybe zero.
if (count > 0) { if (count > 0) {
srs_verbose("mw wait %dms and got %d msgs %d(%"PRId64"-%"PRId64")ms", srs_verbose("mw wait %dms and got %d msgs %d(%" PRId64 "-%" PRId64 ")ms",
mw_sleep, count, mw_sleep, count,
(count > 0? msgs.msgs[count - 1]->timestamp - msgs.msgs[0]->timestamp : 0), (count > 0? msgs.msgs[count - 1]->timestamp - msgs.msgs[0]->timestamp : 0),
(count > 0? msgs.msgs[0]->timestamp : 0), (count > 0? msgs.msgs[0]->timestamp : 0),
@ -981,7 +981,7 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd)
// when not got any messages, timeout. // when not got any messages, timeout.
if (trd->nb_msgs() <= nb_msgs) { if (trd->nb_msgs() <= nb_msgs) {
ret = ERROR_SOCKET_TIMEOUT; ret = ERROR_SOCKET_TIMEOUT;
srs_warn("publish timeout %dms, nb_msgs=%"PRId64", ret=%d", srs_warn("publish timeout %dms, nb_msgs=%" PRId64 ", ret=%d",
nb_msgs? publish_normal_timeout : publish_1stpkt_timeout, nb_msgs, ret); nb_msgs? publish_normal_timeout : publish_1stpkt_timeout, nb_msgs, ret);
break; break;
} }
@ -1000,8 +1000,8 @@ int SrsRtmpConn::do_publishing(SrsSource* source, SrsPublishRecvThread* trd)
kbps->sample(); kbps->sample();
bool mr = _srs_config->get_mr_enabled(req->vhost); bool mr = _srs_config->get_mr_enabled(req->vhost);
int mr_sleep = _srs_config->get_mr_sleep_ms(req->vhost); int mr_sleep = _srs_config->get_mr_sleep_ms(req->vhost);
srs_trace("<- "SRS_CONSTS_LOG_CLIENT_PUBLISH srs_trace("<- " SRS_CONSTS_LOG_CLIENT_PUBLISH
" time=%"PRId64", okbps=%d,%d,%d, ikbps=%d,%d,%d, mr=%d/%d, p1stpt=%d, pnt=%d", pprint->age(), " time=%" PRId64 ", okbps=%d,%d,%d, ikbps=%d,%d,%d, mr=%d/%d, p1stpt=%d, pnt=%d", pprint->age(),
kbps->get_send_kbps(), kbps->get_send_kbps_30s(), kbps->get_send_kbps_5m(), kbps->get_send_kbps(), kbps->get_send_kbps_30s(), kbps->get_send_kbps_5m(),
kbps->get_recv_kbps(), kbps->get_recv_kbps_30s(), kbps->get_recv_kbps_5m(), kbps->get_recv_kbps(), kbps->get_recv_kbps_30s(), kbps->get_recv_kbps_5m(),
mr, mr_sleep, publish_1stpkt_timeout, publish_normal_timeout mr, mr_sleep, publish_1stpkt_timeout, publish_normal_timeout

View file

@ -102,7 +102,7 @@ int SrsRtpConn::on_udp_packet(sockaddr_in* from, char* buf, int nb_buf)
cache->copy(&pkt); cache->copy(&pkt);
cache->payload->append(pkt.payload->bytes(), pkt.payload->length()); cache->payload->append(pkt.payload->bytes(), pkt.payload->length());
if (!cache->completed && pprint->can_print()) { if (!cache->completed && pprint->can_print()) {
srs_trace("<- "SRS_CONSTS_LOG_STREAM_CASTER" rtsp: rtp chunked %dB, age=%d, vt=%d/%u, sts=%u/%#x/%#x, paylod=%dB", srs_trace("<- " SRS_CONSTS_LOG_STREAM_CASTER " rtsp: rtp chunked %dB, age=%d, vt=%d/%u, sts=%u/%#x/%#x, paylod=%dB",
nb_buf, pprint->age(), cache->version, cache->payload_type, cache->sequence_number, cache->timestamp, cache->ssrc, nb_buf, pprint->age(), cache->version, cache->payload_type, cache->sequence_number, cache->timestamp, cache->ssrc,
cache->payload->length() cache->payload->length()
); );
@ -116,7 +116,7 @@ int SrsRtpConn::on_udp_packet(sockaddr_in* from, char* buf, int nb_buf)
} }
if (pprint->can_print()) { if (pprint->can_print()) {
srs_trace("<- "SRS_CONSTS_LOG_STREAM_CASTER" rtsp: rtp #%d %dB, age=%d, vt=%d/%u, sts=%u/%u/%#x, paylod=%dB, chunked=%d", srs_trace("<- " SRS_CONSTS_LOG_STREAM_CASTER " rtsp: rtp #%d %dB, age=%d, vt=%d/%u, sts=%u/%u/%#x, paylod=%dB, chunked=%d",
stream_id, nb_buf, pprint->age(), cache->version, cache->payload_type, cache->sequence_number, cache->timestamp, cache->ssrc, stream_id, nb_buf, pprint->age(), cache->version, cache->payload_type, cache->sequence_number, cache->timestamp, cache->ssrc,
cache->payload->length(), cache->chunked cache->payload->length(), cache->chunked
); );
@ -685,7 +685,7 @@ int SrsRtspConn::connect()
if ((ret = sdk->connect()) != ERROR_SUCCESS) { if ((ret = sdk->connect()) != ERROR_SUCCESS) {
close(); close();
srs_error("rtsp: connect %s failed, cto=%"PRId64", sto=%"PRId64". ret=%d", url.c_str(), cto, sto, ret); srs_error("rtsp: connect %s failed, cto=%" PRId64 ", sto=%" PRId64 ". ret=%d", url.c_str(), cto, sto, ret);
return ret; return ret;
} }

View file

@ -136,10 +136,10 @@ int SrsRtmpJitter::correct(SrsSharedPtrMessage* msg, SrsRtmpJitterAlgorithm ag)
// @see https://github.com/ossrs/srs/issues/425 // @see https://github.com/ossrs/srs/issues/425
delta = DEFAULT_FRAME_TIME_MS; delta = DEFAULT_FRAME_TIME_MS;
srs_info("jitter detected, last_pts=%"PRId64", pts=%"PRId64", diff=%"PRId64", last_time=%"PRId64", time=%"PRId64", diff=%"PRId64"", srs_info("jitter detected, last_pts=%" PRId64 ", pts=%" PRId64 ", diff=%" PRId64 ", last_time=%" PRId64 ", time=%" PRId64 ", diff=%" PRId64 "",
last_pkt_time, time, time - last_pkt_time, last_pkt_correct_time, last_pkt_correct_time + delta, delta); last_pkt_time, time, time - last_pkt_time, last_pkt_correct_time, last_pkt_correct_time + delta, delta);
} else { } else {
srs_verbose("timestamp no jitter. time=%"PRId64", last_pkt=%"PRId64", correct_to=%"PRId64"", srs_verbose("timestamp no jitter. time=%" PRId64 ", last_pkt=%" PRId64 ", correct_to=%" PRId64 "",
time, last_pkt_time, last_pkt_correct_time + delta); time, last_pkt_time, last_pkt_correct_time + delta);
} }
@ -485,7 +485,7 @@ int SrsConsumer::enqueue(SrsSharedPtrMessage* shared_msg, bool atc, SrsRtmpJitte
} }
#ifdef SRS_PERF_QUEUE_COND_WAIT #ifdef SRS_PERF_QUEUE_COND_WAIT
srs_verbose("enqueue msg, time=%"PRId64", size=%d, duration=%d, waiting=%d, min_msg=%d", srs_verbose("enqueue msg, time=%" PRId64 ", size=%d, duration=%d, waiting=%d, min_msg=%d",
msg->timestamp, msg->size, queue->duration(), mw_waiting, mw_min_msgs); msg->timestamp, msg->size, queue->duration(), mw_waiting, mw_min_msgs);
// fire the mw when msgs is enough. // fire the mw when msgs is enough.
@ -2156,7 +2156,7 @@ int SrsSource::on_audio(SrsCommonMessage* shared_audio)
srs_error("initialize the audio failed. ret=%d", ret); srs_error("initialize the audio failed. ret=%d", ret);
return ret; return ret;
} }
srs_info("Audio dts=%"PRId64", size=%d", msg.timestamp, msg.size); srs_info("Audio dts=%" PRId64 ", size=%d", msg.timestamp, msg.size);
// directly process the audio message. // directly process the audio message.
if (!mix_correct) { if (!mix_correct) {
@ -2187,7 +2187,7 @@ int SrsSource::on_audio_imp(SrsSharedPtrMessage* msg)
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
srs_info("Audio dts=%"PRId64", size=%d", msg->timestamp, msg->size); srs_info("Audio dts=%" PRId64 ", size=%d", msg->timestamp, msg->size);
bool is_aac_sequence_header = SrsFlvAudio::sh(msg->payload, msg->size); bool is_aac_sequence_header = SrsFlvAudio::sh(msg->payload, msg->size);
bool is_sequence_header = is_aac_sequence_header; bool is_sequence_header = is_aac_sequence_header;
@ -2281,7 +2281,7 @@ int SrsSource::on_video(SrsCommonMessage* shared_video)
srs_error("initialize the video failed. ret=%d", ret); srs_error("initialize the video failed. ret=%d", ret);
return ret; return ret;
} }
srs_info("Video dts=%"PRId64", size=%d", msg.timestamp, msg.size); srs_info("Video dts=%" PRId64 ", size=%d", msg.timestamp, msg.size);
// directly process the audio message. // directly process the audio message.
if (!mix_correct) { if (!mix_correct) {
@ -2312,7 +2312,7 @@ int SrsSource::on_video_imp(SrsSharedPtrMessage* msg)
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
srs_info("Video dts=%"PRId64", size=%d", msg->timestamp, msg->size); srs_info("Video dts=%" PRId64 ", size=%d", msg->timestamp, msg->size);
bool is_sequence_header = SrsFlvVideo::sh(msg->payload, msg->size); bool is_sequence_header = SrsFlvVideo::sh(msg->payload, msg->size);

View file

@ -43,11 +43,11 @@
#define RTMP_SIG_SRS_ROLE "cluster" #define RTMP_SIG_SRS_ROLE "cluster"
#define RTMP_SIG_SRS_URL "https://github.com/ossrs/srs" #define RTMP_SIG_SRS_URL "https://github.com/ossrs/srs"
#define RTMP_SIG_SRS_LICENSE "The MIT License (MIT)" #define RTMP_SIG_SRS_LICENSE "The MIT License (MIT)"
#define RTMP_SIG_SRS_COPYRIGHT "Copyright (c) 2013-2017 "RTMP_SIG_SRS_KEY"("RTMP_SIG_SRS_AUTHROS")" #define RTMP_SIG_SRS_COPYRIGHT "Copyright (c) 2013-2017 " RTMP_SIG_SRS_KEY "(" RTMP_SIG_SRS_AUTHROS ")"
#define RTMP_SIG_SRS_PRIMARY RTMP_SIG_SRS_KEY"/"VERSION_STABLE_BRANCH #define RTMP_SIG_SRS_PRIMARY RTMP_SIG_SRS_KEY "/" VERSION_STABLE_BRANCH
#define RTMP_SIG_SRS_HANDSHAKE RTMP_SIG_SRS_KEY"("RTMP_SIG_SRS_VERSION")" #define RTMP_SIG_SRS_HANDSHAKE RTMP_SIG_SRS_KEY "(" RTMP_SIG_SRS_VERSION ")"
#define RTMP_SIG_SRS_VERSION SRS_XSTR(VERSION_MAJOR)"."SRS_XSTR(VERSION_MINOR)"."SRS_XSTR(VERSION_REVISION) #define RTMP_SIG_SRS_VERSION SRS_XSTR(VERSION_MAJOR) "." SRS_XSTR(VERSION_MINOR) "." SRS_XSTR(VERSION_REVISION)
#define RTMP_SIG_SRS_SERVER RTMP_SIG_SRS_KEY"/"RTMP_SIG_SRS_VERSION"("RTMP_SIG_SRS_CODE")" #define RTMP_SIG_SRS_SERVER RTMP_SIG_SRS_KEY "/" RTMP_SIG_SRS_VERSION "(" RTMP_SIG_SRS_CODE ")"
// stable major version // stable major version
#define VERSION_STABLE 2 #define VERSION_STABLE 2

View file

@ -959,7 +959,7 @@ int SrsFlvVodStreamDecoder::seek2(int64_t offset)
if (offset >= reader->filesize()) { if (offset >= reader->filesize()) {
ret = ERROR_SYSTEM_FILE_EOF; ret = ERROR_SYSTEM_FILE_EOF;
srs_warn("flv fast decoder seek overflow file, " srs_warn("flv fast decoder seek overflow file, "
"size=%"PRId64", offset=%"PRId64", ret=%d", "size=%" PRId64 ", offset=%" PRId64 ", ret=%d",
reader->filesize(), offset, ret); reader->filesize(), offset, ret);
return ret; return ret;
} }
@ -967,7 +967,7 @@ int SrsFlvVodStreamDecoder::seek2(int64_t offset)
if (reader->seek2(offset) < 0) { if (reader->seek2(offset) < 0) {
ret = ERROR_SYSTEM_FILE_SEEK; ret = ERROR_SYSTEM_FILE_SEEK;
srs_warn("flv fast decoder seek error, " srs_warn("flv fast decoder seek error, "
"size=%"PRId64", offset=%"PRId64", ret=%d", "size=%" PRId64 ", offset=%" PRId64 ", ret=%d",
reader->filesize(), offset, ret); reader->filesize(), offset, ret);
return ret; return ret;
} }

View file

@ -190,7 +190,7 @@ int SrsMp4Box::discovery(SrsBuffer* buf, SrsMp4Box** ppbox)
// Only support 31bits size. // Only support 31bits size.
if (largesize > 0x7fffffff) { if (largesize > 0x7fffffff) {
ret = ERROR_MP4_BOX_OVERFLOW; ret = ERROR_MP4_BOX_OVERFLOW;
srs_error("MP4 discovery overflow 31bits, size=%"PRId64". ret=%d", largesize, ret); srs_error("MP4 discovery overflow 31bits, size=%" PRId64 ". ret=%d", largesize, ret);
return ret; return ret;
} }
@ -370,7 +370,7 @@ int SrsMp4Box::encode_header(SrsBuffer* buf)
// Only support 31bits size. // Only support 31bits size.
if (sz() > 0x7fffffff) { if (sz() > 0x7fffffff) {
ret = ERROR_MP4_BOX_OVERFLOW; ret = ERROR_MP4_BOX_OVERFLOW;
srs_error("MP4 box size overflow 31bits, size=%"PRId64". ret=%d", sz(), ret); srs_error("MP4 box size overflow 31bits, size=%" PRId64 ". ret=%d", sz(), ret);
return ret; return ret;
} }
@ -430,7 +430,7 @@ int SrsMp4Box::decode_header(SrsBuffer* buf)
// Only support 31bits size. // Only support 31bits size.
if (sz() > 0x7fffffff) { if (sz() > 0x7fffffff) {
ret = ERROR_MP4_BOX_OVERFLOW; ret = ERROR_MP4_BOX_OVERFLOW;
srs_error("MP4 box size overflow 31bits, size=%"PRId64". ret=%d", sz(), ret); srs_error("MP4 box size overflow 31bits, size=%" PRId64 ". ret=%d", sz(), ret);
return ret; return ret;
} }

View file

@ -1142,7 +1142,7 @@ int SrsTsAdaptationField::decode(SrsBuffer* stream)
nb_af_reserved = adaption_field_length - (stream->pos() - pos_af); nb_af_reserved = adaption_field_length - (stream->pos() - pos_af);
stream->skip(nb_af_reserved); stream->skip(nb_af_reserved);
srs_info("ts: af parsed, discontinuity=%d random=%d priority=%d PCR=%d OPCR=%d slicing=%d private=%d extension=%d/%d pcr=%"PRId64"/%d opcr=%"PRId64"/%d", srs_info("ts: af parsed, discontinuity=%d random=%d priority=%d PCR=%d OPCR=%d slicing=%d private=%d extension=%d/%d pcr=%" PRId64 "/%d opcr=%" PRId64 "/%d",
discontinuity_indicator, random_access_indicator, elementary_stream_priority_indicator, PCR_flag, OPCR_flag, splicing_point_flag, discontinuity_indicator, random_access_indicator, elementary_stream_priority_indicator, PCR_flag, OPCR_flag, splicing_point_flag,
transport_private_data_flag, adaptation_field_extension_flag, adaptation_field_extension_length, program_clock_reference_base, transport_private_data_flag, adaptation_field_extension_flag, adaptation_field_extension_length, program_clock_reference_base,
program_clock_reference_extension, original_program_clock_reference_base, original_program_clock_reference_extension); program_clock_reference_extension, original_program_clock_reference_base, original_program_clock_reference_extension);
@ -1323,7 +1323,7 @@ int SrsTsAdaptationField::encode(SrsBuffer* stream)
stream->skip(nb_af_reserved); stream->skip(nb_af_reserved);
} }
srs_info("ts: af parsed, discontinuity=%d random=%d priority=%d PCR=%d OPCR=%d slicing=%d private=%d extension=%d/%d pcr=%"PRId64"/%d opcr=%"PRId64"/%d", srs_info("ts: af parsed, discontinuity=%d random=%d priority=%d PCR=%d OPCR=%d slicing=%d private=%d extension=%d/%d pcr=%" PRId64 "/%d opcr=%" PRId64 "/%d",
discontinuity_indicator, random_access_indicator, elementary_stream_priority_indicator, PCR_flag, OPCR_flag, splicing_point_flag, discontinuity_indicator, random_access_indicator, elementary_stream_priority_indicator, PCR_flag, OPCR_flag, splicing_point_flag,
transport_private_data_flag, adaptation_field_extension_flag, adaptation_field_extension_length, program_clock_reference_base, transport_private_data_flag, adaptation_field_extension_flag, adaptation_field_extension_length, program_clock_reference_base,
program_clock_reference_extension, original_program_clock_reference_base, original_program_clock_reference_extension); program_clock_reference_extension, original_program_clock_reference_base, original_program_clock_reference_extension);
@ -1563,7 +1563,7 @@ int SrsTsPayloadPES::decode(SrsBuffer* stream, SrsTsMessage** ppmsg)
// check sync, the diff of dts and pts should never greater than 1s. // check sync, the diff of dts and pts should never greater than 1s.
if (dts - pts > 90000 || pts - dts > 90000) { if (dts - pts > 90000 || pts - dts > 90000) {
srs_warn("ts: sync dts=%"PRId64", pts=%"PRId64, dts, pts); srs_warn("ts: sync dts=%" PRId64 ", pts=%" PRId64, dts, pts);
} }
// update the dts and pts of message. // update the dts and pts of message.
@ -1923,7 +1923,7 @@ int SrsTsPayloadPES::encode(SrsBuffer* stream)
// check sync, the diff of dts and pts should never greater than 1s. // check sync, the diff of dts and pts should never greater than 1s.
if (dts - pts > 90000 || pts - dts > 90000) { if (dts - pts > 90000 || pts - dts > 90000) {
srs_warn("ts: sync dts=%"PRId64", pts=%"PRId64, dts, pts); srs_warn("ts: sync dts=%" PRId64 ", pts=%" PRId64, dts, pts);
} }
} }
@ -2753,7 +2753,7 @@ int SrsTsContextWriter::write_audio(SrsTsMessage* audio)
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
srs_info("hls: write audio pts=%"PRId64", dts=%"PRId64", size=%d", srs_info("hls: write audio pts=%" PRId64 ", dts=%" PRId64 ", size=%d",
audio->pts, audio->dts, audio->PES_packet_length); audio->pts, audio->dts, audio->PES_packet_length);
if ((ret = context->encode(writer, audio, vcodec, acodec)) != ERROR_SUCCESS) { if ((ret = context->encode(writer, audio, vcodec, acodec)) != ERROR_SUCCESS) {
@ -2769,7 +2769,7 @@ int SrsTsContextWriter::write_video(SrsTsMessage* video)
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
srs_info("hls: write video pts=%"PRId64", dts=%"PRId64", size=%d", srs_info("hls: write video pts=%" PRId64 ", dts=%" PRId64 ", size=%d",
video->pts, video->dts, video->PES_packet_length); video->pts, video->dts, video->PES_packet_length);
if ((ret = context->encode(writer, video, vcodec, acodec)) != ERROR_SUCCESS) { if ((ret = context->encode(writer, video, vcodec, acodec)) != ERROR_SUCCESS) {

View file

@ -143,13 +143,13 @@ int64_t srs_update_system_time_ms()
int64_t diff = now_us - _srs_system_time_us_cache; int64_t diff = now_us - _srs_system_time_us_cache;
diff = srs_max(0, diff); diff = srs_max(0, diff);
if (diff < 0 || diff > 1000 * SYS_TIME_RESOLUTION_US) { if (diff < 0 || diff > 1000 * SYS_TIME_RESOLUTION_US) {
srs_warn("clock jump, history=%"PRId64"us, now=%"PRId64"us, diff=%"PRId64"us", _srs_system_time_us_cache, now_us, diff); srs_warn("clock jump, history=%" PRId64 "us, now=%" PRId64 "us, diff=%" PRId64 "us", _srs_system_time_us_cache, now_us, diff);
// @see: https://github.com/ossrs/srs/issues/109 // @see: https://github.com/ossrs/srs/issues/109
_srs_system_time_startup_time += diff; _srs_system_time_startup_time += diff;
} }
_srs_system_time_us_cache = now_us; _srs_system_time_us_cache = now_us;
srs_info("clock updated, startup=%"PRId64"us, now=%"PRId64"us", _srs_system_time_startup_time, _srs_system_time_us_cache); srs_info("clock updated, startup=%" PRId64 "us, now=%" PRId64 "us", _srs_system_time_startup_time, _srs_system_time_us_cache);
return _srs_system_time_us_cache / 1000; return _srs_system_time_us_cache / 1000;
} }
@ -206,7 +206,7 @@ string srs_int2str(int64_t value)
{ {
// len(max int64_t) is 20, plus one "+-." // len(max int64_t) is 20, plus one "+-."
char tmp[22]; char tmp[22];
snprintf(tmp, 22, "%"PRId64, value); snprintf(tmp, 22, "%" PRId64, value);
return tmp; return tmp;
} }

View file

@ -2649,20 +2649,20 @@ extern "C"{
uint32_t pts; uint32_t pts;
if ((ret = srs_utils_parse_timestamp(timestamp, type, data, size, &pts)) != ERROR_SUCCESS) { if ((ret = srs_utils_parse_timestamp(timestamp, type, data, size, &pts)) != ERROR_SUCCESS) {
snprintf(buffer, nb_buffer, "Rtmp packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, ndiff=%d, diff=%d, size=%d, DecodeError, (%s), ret=%d", snprintf(buffer, nb_buffer, "Rtmp packet id=%" PRId64 "/%.1f/%.1f, type=%s, dts=%d, ndiff=%d, diff=%d, size=%d, DecodeError, (%s), ret=%d",
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, ndiff, diff, size, sbytes, ret); nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, ndiff, diff, size, sbytes, ret);
return ret; return ret;
} }
if (type == SRS_RTMP_TYPE_VIDEO) { if (type == SRS_RTMP_TYPE_VIDEO) {
snprintf(buffer, nb_buffer, "Video packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, pts=%d, ndiff=%d, diff=%d, size=%d, %s(%s,%s), (%s)", snprintf(buffer, nb_buffer, "Video packet id=%" PRId64 "/%.1f/%.1f, type=%s, dts=%d, pts=%d, ndiff=%d, diff=%d, size=%d, %s(%s,%s), (%s)",
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, ndiff, diff, size, nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, ndiff, diff, size,
srs_human_flv_video_codec_id2string(srs_utils_flv_video_codec_id(data, size)), srs_human_flv_video_codec_id2string(srs_utils_flv_video_codec_id(data, size)),
srs_human_flv_video_avc_packet_type2string(srs_utils_flv_video_avc_packet_type(data, size)), srs_human_flv_video_avc_packet_type2string(srs_utils_flv_video_avc_packet_type(data, size)),
srs_human_flv_video_frame_type2string(srs_utils_flv_video_frame_type(data, size)), srs_human_flv_video_frame_type2string(srs_utils_flv_video_frame_type(data, size)),
sbytes); sbytes);
} else if (type == SRS_RTMP_TYPE_AUDIO) { } else if (type == SRS_RTMP_TYPE_AUDIO) {
snprintf(buffer, nb_buffer, "Audio packet id=%"PRId64"/%.1f/%.1f, type=%s, dts=%d, pts=%d, ndiff=%d, diff=%d, size=%d, %s(%s,%s,%s,%s), (%s)", snprintf(buffer, nb_buffer, "Audio packet id=%" PRId64 "/%.1f/%.1f, type=%s, dts=%d, pts=%d, ndiff=%d, diff=%d, size=%d, %s(%s,%s,%s,%s), (%s)",
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, ndiff, diff, size, nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, pts, ndiff, diff, size,
srs_human_flv_audio_sound_format2string(srs_utils_flv_audio_sound_format(data, size)), srs_human_flv_audio_sound_format2string(srs_utils_flv_audio_sound_format(data, size)),
srs_human_flv_audio_sound_rate2string(srs_utils_flv_audio_sound_rate(data, size)), srs_human_flv_audio_sound_rate2string(srs_utils_flv_audio_sound_rate(data, size)),
@ -2671,7 +2671,7 @@ extern "C"{
srs_human_flv_audio_aac_packet_type2string(srs_utils_flv_audio_aac_packet_type(data, size)), srs_human_flv_audio_aac_packet_type2string(srs_utils_flv_audio_aac_packet_type(data, size)),
sbytes); sbytes);
} else if (type == SRS_RTMP_TYPE_SCRIPT) { } else if (type == SRS_RTMP_TYPE_SCRIPT) {
int nb = snprintf(buffer, nb_buffer, "Data packet id=%"PRId64"/%.1f/%.1f, type=%s, time=%d, ndiff=%d, diff=%d, size=%d, (%s)", int nb = snprintf(buffer, nb_buffer, "Data packet id=%" PRId64 "/%.1f/%.1f, type=%s, time=%d, ndiff=%d, diff=%d, size=%d, (%s)",
nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, ndiff, diff, size, sbytes); nb_packets, pi, gfps, srs_human_flv_tag_type2string(type), timestamp, ndiff, diff, size, sbytes);
int nparsed = 0; int nparsed = 0;
while (nparsed < size) { while (nparsed < size) {
@ -2689,7 +2689,7 @@ extern "C"{
} }
buffer[nb] = 0; buffer[nb] = 0;
} else { } else {
snprintf(buffer, nb_buffer, "Rtmp packet id=%"PRId64"/%.1f/%.1f, type=%#x, dts=%d, pts=%d, ndiff=%d, diff=%d, size=%d, (%s)", snprintf(buffer, nb_buffer, "Rtmp packet id=%" PRId64 "/%.1f/%.1f, type=%#x, dts=%d, pts=%d, ndiff=%d, diff=%d, size=%d, (%s)",
nb_packets, pi, gfps, type, timestamp, pts, ndiff, diff, size, sbytes); nb_packets, pi, gfps, type, timestamp, pts, ndiff, diff, size, sbytes);
} }

View file

@ -739,7 +739,7 @@ int SrsIngestHlsOutput::on_ts_message(SrsTsMessage* msg)
// 14496-2 video stream number xxxx // 14496-2 video stream number xxxx
// ((stream_id >> 4) & 0x0f) == SrsTsPESStreamIdVideo // ((stream_id >> 4) & 0x0f) == SrsTsPESStreamIdVideo
srs_info("<- "SRS_CONSTS_LOG_STREAM_CASTER" mpegts: got %s stream=%s, dts=%"PRId64", pts=%"PRId64", size=%d, us=%d, cc=%d, sid=%#x(%s-%d)", srs_info("<- " SRS_CONSTS_LOG_STREAM_CASTER " mpegts: got %s stream=%s, dts=%" PRId64 ", pts=%" PRId64 ", size=%d, us=%d, cc=%d, sid=%#x(%s-%d)",
(msg->channel->apply == SrsTsPidApplyVideo)? "Video":"Audio", srs_ts_stream2string(msg->channel->stream).c_str(), (msg->channel->apply == SrsTsPidApplyVideo)? "Video":"Audio", srs_ts_stream2string(msg->channel->stream).c_str(),
msg->dts, msg->pts, msg->payload->length(), msg->packet->payload_unit_start_indicator, msg->continuity_counter, msg->sid, msg->dts, msg->pts, msg->payload->length(), msg->packet->payload_unit_start_indicator, msg->continuity_counter, msg->sid,
msg->is_audio()? "A":msg->is_video()? "V":"N", msg->stream_number()); msg->is_audio()? "A":msg->is_video()? "V":"N", msg->stream_number());
@ -778,7 +778,7 @@ int SrsIngestHlsOutput::on_aac_frame(char* frame, int frame_size, double duratio
{ {
int ret = ERROR_SUCCESS; int ret = ERROR_SUCCESS;
srs_trace("handle aac frames, size=%dB, duration=%.2f, dts=%"PRId64, frame_size, duration, raw_aac_dts); srs_trace("handle aac frames, size=%dB, duration=%.2f, dts=%" PRId64, frame_size, duration, raw_aac_dts);
SrsBuffer stream; SrsBuffer stream;
if ((ret = stream.initialize(frame, frame_size)) != ERROR_SUCCESS) { if ((ret = stream.initialize(frame, frame_size)) != ERROR_SUCCESS) {
@ -1220,7 +1220,7 @@ int SrsIngestHlsOutput::connect()
if ((ret = sdk->connect()) != ERROR_SUCCESS) { if ((ret = sdk->connect()) != ERROR_SUCCESS) {
close(); close();
srs_error("mpegts: connect %s failed, cto=%"PRId64", sto=%"PRId64". ret=%d", url.c_str(), cto, sto, ret); srs_error("mpegts: connect %s failed, cto=%" PRId64 ", sto=%" PRId64 ". ret=%d", url.c_str(), cto, sto, ret);
return ret; return ret;
} }

View file

@ -117,14 +117,14 @@ int main(int argc, char** argv)
} }
// config already applied to log. // config already applied to log.
srs_trace(RTMP_SIG_SRS_SERVER", stable is "RTMP_SIG_SRS_PRIMARY); srs_trace(RTMP_SIG_SRS_SERVER ", stable is " RTMP_SIG_SRS_PRIMARY);
srs_trace("license: "RTMP_SIG_SRS_LICENSE", "RTMP_SIG_SRS_COPYRIGHT); srs_trace("license: " RTMP_SIG_SRS_LICENSE ", " RTMP_SIG_SRS_COPYRIGHT);
srs_trace("authors: "RTMP_SIG_SRS_AUTHROS); srs_trace("authors: " RTMP_SIG_SRS_AUTHROS);
srs_trace("contributors: "SRS_AUTO_CONSTRIBUTORS); srs_trace("contributors: " SRS_AUTO_CONSTRIBUTORS);
srs_trace("build: %s, configure:%s, uname: %s", SRS_AUTO_BUILD_DATE, SRS_AUTO_USER_CONFIGURE, SRS_AUTO_UNAME); srs_trace("build: %s, configure:%s, uname: %s", SRS_AUTO_BUILD_DATE, SRS_AUTO_USER_CONFIGURE, SRS_AUTO_UNAME);
srs_trace("configure detail: "SRS_AUTO_CONFIGURE); srs_trace("configure detail: " SRS_AUTO_CONFIGURE);
#ifdef SRS_AUTO_EMBEDED_TOOL_CHAIN #ifdef SRS_AUTO_EMBEDED_TOOL_CHAIN
srs_trace("crossbuild tool chain: "SRS_AUTO_EMBEDED_TOOL_CHAIN); srs_trace("crossbuild tool chain: " SRS_AUTO_EMBEDED_TOOL_CHAIN);
#endif #endif
srs_trace("cwd=%s, work_dir=%s", _srs_config->cwd().c_str(), cwd.c_str()); srs_trace("cwd=%s, work_dir=%s", _srs_config->cwd().c_str(), cwd.c_str());

View file

@ -1470,7 +1470,7 @@ int SrsAmf0Date::read(SrsBuffer* stream)
} }
_date_value = stream->read_8bytes(); _date_value = stream->read_8bytes();
srs_verbose("amf0 read date success. date=%"PRId64, _date_value); srs_verbose("amf0 read date success. date=%" PRId64, _date_value);
// time zone // time zone
// While the design of this type reserves room for time zone offset // While the design of this type reserves room for time zone offset
@ -1510,7 +1510,7 @@ int SrsAmf0Date::write(SrsBuffer* stream)
} }
stream->write_8bytes(_date_value); stream->write_8bytes(_date_value);
srs_verbose("amf0 write date success. date=%"PRId64, _date_value); srs_verbose("amf0 write date success. date=%" PRId64, _date_value);
// time zone // time zone
if (!stream->require(2)) { if (!stream->require(2)) {

View file

@ -385,7 +385,7 @@ int SrsProtocol::recv_message(SrsCommonMessage** pmsg)
} }
if (msg->size <= 0 || msg->header.payload_length <= 0) { if (msg->size <= 0 || msg->header.payload_length <= 0) {
srs_trace("ignore empty message(type=%d, size=%d, time=%"PRId64", sid=%d).", srs_trace("ignore empty message(type=%d, size=%d, time=%" PRId64 ", sid=%d).",
msg->header.message_type, msg->header.payload_length, msg->header.message_type, msg->header.payload_length,
msg->header.timestamp, msg->header.stream_id); msg->header.timestamp, msg->header.stream_id);
srs_freep(msg); srs_freep(msg);
@ -398,7 +398,7 @@ int SrsProtocol::recv_message(SrsCommonMessage** pmsg)
return ret; return ret;
} }
srs_verbose("got a msg, cid=%d, type=%d, size=%d, time=%"PRId64, srs_verbose("got a msg, cid=%d, type=%d, size=%d, time=%" PRId64,
msg->header.perfer_cid, msg->header.message_type, msg->header.payload_length, msg->header.perfer_cid, msg->header.message_type, msg->header.payload_length,
msg->header.timestamp); msg->header.timestamp);
*pmsg = msg; *pmsg = msg;
@ -953,7 +953,7 @@ int SrsProtocol::recv_interlaced_message(SrsCommonMessage** pmsg)
srs_verbose("cs-cache hit, cid=%d", cid); srs_verbose("cs-cache hit, cid=%d", cid);
// already init, use it direclty // already init, use it direclty
chunk = cs_cache[cid]; chunk = cs_cache[cid];
srs_verbose("cached chunk stream: fmt=%d, cid=%d, size=%d, message(type=%d, size=%d, time=%"PRId64", sid=%d)", srs_verbose("cached chunk stream: fmt=%d, cid=%d, size=%d, message(type=%d, size=%d, time=%" PRId64 ", sid=%d)",
chunk->fmt, chunk->cid, (chunk->msg? chunk->msg->size : 0), chunk->header.message_type, chunk->header.payload_length, chunk->fmt, chunk->cid, (chunk->msg? chunk->msg->size : 0), chunk->header.message_type, chunk->header.payload_length,
chunk->header.timestamp, chunk->header.stream_id); chunk->header.timestamp, chunk->header.stream_id);
} else { } else {
@ -966,7 +966,7 @@ int SrsProtocol::recv_interlaced_message(SrsCommonMessage** pmsg)
srs_verbose("cache new chunk stream: fmt=%d, cid=%d", fmt, cid); srs_verbose("cache new chunk stream: fmt=%d, cid=%d", fmt, cid);
} else { } else {
chunk = chunk_streams[cid]; chunk = chunk_streams[cid];
srs_verbose("cached chunk stream: fmt=%d, cid=%d, size=%d, message(type=%d, size=%d, time=%"PRId64", sid=%d)", srs_verbose("cached chunk stream: fmt=%d, cid=%d, size=%d, message(type=%d, size=%d, time=%" PRId64 ", sid=%d)",
chunk->fmt, chunk->cid, (chunk->msg? chunk->msg->size : 0), chunk->header.message_type, chunk->header.payload_length, chunk->fmt, chunk->cid, (chunk->msg? chunk->msg->size : 0), chunk->header.message_type, chunk->header.payload_length,
chunk->header.timestamp, chunk->header.stream_id); chunk->header.timestamp, chunk->header.stream_id);
} }
@ -980,7 +980,7 @@ int SrsProtocol::recv_interlaced_message(SrsCommonMessage** pmsg)
return ret; return ret;
} }
srs_verbose("read message header success. " srs_verbose("read message header success. "
"fmt=%d, ext_time=%d, size=%d, message(type=%d, size=%d, time=%"PRId64", sid=%d)", "fmt=%d, ext_time=%d, size=%d, message(type=%d, size=%d, time=%" PRId64 ", sid=%d)",
fmt, chunk->extended_timestamp, (chunk->msg? chunk->msg->size : 0), chunk->header.message_type, fmt, chunk->extended_timestamp, (chunk->msg? chunk->msg->size : 0), chunk->header.message_type,
chunk->header.payload_length, chunk->header.timestamp, chunk->header.stream_id); chunk->header.payload_length, chunk->header.timestamp, chunk->header.stream_id);
@ -995,14 +995,14 @@ int SrsProtocol::recv_interlaced_message(SrsCommonMessage** pmsg)
// not got an entire RTMP message, try next chunk. // not got an entire RTMP message, try next chunk.
if (!msg) { if (!msg) {
srs_verbose("get partial message success. size=%d, message(type=%d, size=%d, time=%"PRId64", sid=%d)", srs_verbose("get partial message success. size=%d, message(type=%d, size=%d, time=%" PRId64 ", sid=%d)",
(msg? msg->size : (chunk->msg? chunk->msg->size : 0)), chunk->header.message_type, chunk->header.payload_length, (msg? msg->size : (chunk->msg? chunk->msg->size : 0)), chunk->header.message_type, chunk->header.payload_length,
chunk->header.timestamp, chunk->header.stream_id); chunk->header.timestamp, chunk->header.stream_id);
return ret; return ret;
} }
*pmsg = msg; *pmsg = msg;
srs_info("get entire message success. size=%d, message(type=%d, size=%d, time=%"PRId64", sid=%d)", srs_info("get entire message success. size=%d, message(type=%d, size=%d, time=%" PRId64 ", sid=%d)",
(msg? msg->size : (chunk->msg? chunk->msg->size : 0)), chunk->header.message_type, chunk->header.payload_length, (msg? msg->size : (chunk->msg? chunk->msg->size : 0)), chunk->header.message_type, chunk->header.payload_length,
chunk->header.timestamp, chunk->header.stream_id); chunk->header.timestamp, chunk->header.stream_id);
@ -1285,16 +1285,16 @@ int SrsProtocol::read_message_header(SrsChunkStream* chunk, char fmt)
pp[1] = *p++; pp[1] = *p++;
pp[2] = *p++; pp[2] = *p++;
pp[3] = *p++; pp[3] = *p++;
srs_verbose("header read completed. fmt=%d, mh_size=%d, ext_time=%d, time=%"PRId64", payload=%d, type=%d, sid=%d", srs_verbose("header read completed. fmt=%d, mh_size=%d, ext_time=%d, time=%" PRId64 ", payload=%d, type=%d, sid=%d",
fmt, mh_size, chunk->extended_timestamp, chunk->header.timestamp, chunk->header.payload_length, fmt, mh_size, chunk->extended_timestamp, chunk->header.timestamp, chunk->header.payload_length,
chunk->header.message_type, chunk->header.stream_id); chunk->header.message_type, chunk->header.stream_id);
} else { } else {
srs_verbose("header read completed. fmt=%d, mh_size=%d, ext_time=%d, time=%"PRId64", payload=%d, type=%d", srs_verbose("header read completed. fmt=%d, mh_size=%d, ext_time=%d, time=%" PRId64 ", payload=%d, type=%d",
fmt, mh_size, chunk->extended_timestamp, chunk->header.timestamp, chunk->header.payload_length, fmt, mh_size, chunk->extended_timestamp, chunk->header.timestamp, chunk->header.payload_length,
chunk->header.message_type); chunk->header.message_type);
} }
} else { } else {
srs_verbose("header read completed. fmt=%d, mh_size=%d, ext_time=%d, time=%"PRId64"", srs_verbose("header read completed. fmt=%d, mh_size=%d, ext_time=%d, time=%" PRId64 "",
fmt, mh_size, chunk->extended_timestamp, chunk->header.timestamp); fmt, mh_size, chunk->extended_timestamp, chunk->header.timestamp);
} }
} else { } else {
@ -1365,7 +1365,7 @@ int SrsProtocol::read_message_header(SrsChunkStream* chunk, char fmt)
} else { } else {
chunk->header.timestamp = timestamp; chunk->header.timestamp = timestamp;
} }
srs_verbose("header read ext_time completed. time=%"PRId64"", chunk->header.timestamp); srs_verbose("header read ext_time completed. time=%" PRId64 "", chunk->header.timestamp);
} }
// the extended-timestamp must be unsigned-int, // the extended-timestamp must be unsigned-int,
@ -1410,7 +1410,7 @@ int SrsProtocol::read_message_payload(SrsChunkStream* chunk, SrsCommonMessage**
// empty message // empty message
if (chunk->header.payload_length <= 0) { if (chunk->header.payload_length <= 0) {
srs_trace("get an empty RTMP " srs_trace("get an empty RTMP "
"message(type=%d, size=%d, time=%"PRId64", sid=%d)", chunk->header.message_type, "message(type=%d, size=%d, time=%" PRId64 ", sid=%d)", chunk->header.message_type,
chunk->header.payload_length, chunk->header.timestamp, chunk->header.stream_id); chunk->header.payload_length, chunk->header.timestamp, chunk->header.stream_id);
*pmsg = chunk->msg; *pmsg = chunk->msg;
@ -1447,13 +1447,13 @@ int SrsProtocol::read_message_payload(SrsChunkStream* chunk, SrsCommonMessage**
if (chunk->header.payload_length == chunk->msg->size) { if (chunk->header.payload_length == chunk->msg->size) {
*pmsg = chunk->msg; *pmsg = chunk->msg;
chunk->msg = NULL; chunk->msg = NULL;
srs_verbose("get entire RTMP message(type=%d, size=%d, time=%"PRId64", sid=%d)", srs_verbose("get entire RTMP message(type=%d, size=%d, time=%" PRId64 ", sid=%d)",
chunk->header.message_type, chunk->header.payload_length, chunk->header.message_type, chunk->header.payload_length,
chunk->header.timestamp, chunk->header.stream_id); chunk->header.timestamp, chunk->header.stream_id);
return ret; return ret;
} }
srs_verbose("get partial RTMP message(type=%d, size=%d, time=%"PRId64", sid=%d), partial size=%d", srs_verbose("get partial RTMP message(type=%d, size=%d, time=%" PRId64 ", sid=%d), partial size=%d",
chunk->header.message_type, chunk->header.payload_length, chunk->header.message_type, chunk->header.payload_length,
chunk->header.timestamp, chunk->header.stream_id, chunk->header.timestamp, chunk->header.stream_id,
chunk->msg->size); chunk->msg->size);
@ -2580,7 +2580,7 @@ int SrsRtmpServer::response_connect_app(SrsRequest *req, const char* server_ip)
SrsConnectAppResPacket* pkt = new SrsConnectAppResPacket(); SrsConnectAppResPacket* pkt = new SrsConnectAppResPacket();
pkt->props->set("fmsVer", SrsAmf0Any::str("FMS/"RTMP_SIG_FMS_VER)); pkt->props->set("fmsVer", SrsAmf0Any::str("FMS/" RTMP_SIG_FMS_VER));
pkt->props->set("capabilities", SrsAmf0Any::number(127)); pkt->props->set("capabilities", SrsAmf0Any::number(127));
pkt->props->set("mode", SrsAmf0Any::number(1)); pkt->props->set("mode", SrsAmf0Any::number(1));

View file

@ -423,7 +423,7 @@ public:
T* pkt = dynamic_cast<T*>(packet); T* pkt = dynamic_cast<T*>(packet);
if (!pkt) { if (!pkt) {
srs_info("drop message(type=%d, size=%d, time=%"PRId64", sid=%d).", srs_info("drop message(type=%d, size=%d, time=%" PRId64 ", sid=%d).",
msg->header.message_type, msg->header.payload_length, msg->header.message_type, msg->header.payload_length,
msg->header.timestamp, msg->header.stream_id); msg->header.timestamp, msg->header.stream_id);
srs_freep(msg); srs_freep(msg);

View file

@ -209,7 +209,7 @@ void SrsHttpClient::kbps_sample(const char* label, int64_t age)
int rr30s = kbps->get_recv_kbps_30s(); int rr30s = kbps->get_recv_kbps_30s();
int rr5m = kbps->get_recv_kbps_5m(); int rr5m = kbps->get_recv_kbps_5m();
srs_trace("<- %s time=%"PRId64", okbps=%d,%d,%d, ikbps=%d,%d,%d", label, age, sr, sr30s, sr5m, rr, rr30s, rr5m); srs_trace("<- %s time=%" PRId64 ", okbps=%d,%d,%d, ikbps=%d,%d,%d", label, age, sr, sr30s, sr5m, rr, rr30s, rr5m);
} }
void SrsHttpClient::disconnect() void SrsHttpClient::disconnect()
@ -230,7 +230,7 @@ int SrsHttpClient::connect()
transport = new SrsTcpClient(host, port, timeout); transport = new SrsTcpClient(host, port, timeout);
if ((ret = transport->connect()) != ERROR_SUCCESS) { if ((ret = transport->connect()) != ERROR_SUCCESS) {
disconnect(); disconnect();
srs_warn("http client failed, server=%s, port=%d, timeout=%"PRId64", ret=%d", host.c_str(), port, timeout, ret); srs_warn("http client failed, server=%s, port=%d, timeout=%" PRId64 ", ret=%d", host.c_str(), port, timeout, ret);
return ret; return ret;
} }
srs_info("connect to server success. server=%s, port=%d", host.c_str(), port); srs_info("connect to server success. server=%s, port=%d", host.c_str(), port);

View file

@ -192,7 +192,7 @@ void SrsBasicRtmpClient::kbps_sample(const char* label, int64_t age)
int rr30s = kbps->get_recv_kbps_30s(); int rr30s = kbps->get_recv_kbps_30s();
int rr5m = kbps->get_recv_kbps_5m(); int rr5m = kbps->get_recv_kbps_5m();
srs_trace("<- %s time=%"PRId64", okbps=%d,%d,%d, ikbps=%d,%d,%d", label, age, sr, sr30s, sr5m, rr, rr30s, rr5m); srs_trace("<- %s time=%" PRId64 ", okbps=%d,%d,%d, ikbps=%d,%d,%d", label, age, sr, sr30s, sr5m, rr, rr30s, rr5m);
} }
void SrsBasicRtmpClient::kbps_sample(const char* label, int64_t age, int msgs) void SrsBasicRtmpClient::kbps_sample(const char* label, int64_t age, int msgs)
@ -206,7 +206,7 @@ void SrsBasicRtmpClient::kbps_sample(const char* label, int64_t age, int msgs)
int rr30s = kbps->get_recv_kbps_30s(); int rr30s = kbps->get_recv_kbps_30s();
int rr5m = kbps->get_recv_kbps_5m(); int rr5m = kbps->get_recv_kbps_5m();
srs_trace("<- %s time=%"PRId64", msgs=%d, okbps=%d,%d,%d, ikbps=%d,%d,%d", label, age, msgs, sr, sr30s, sr5m, rr, rr30s, rr5m); srs_trace("<- %s time=%" PRId64 ", msgs=%d, okbps=%d,%d,%d, ikbps=%d,%d,%d", label, age, msgs, sr, sr30s, sr5m, rr, rr30s, rr5m);
} }
int SrsBasicRtmpClient::sid() int SrsBasicRtmpClient::sid()

View file

@ -299,7 +299,7 @@ int SrsTcpClient::connect()
srs_assert(stfd == NULL); srs_assert(stfd == NULL);
if ((ret = srs_socket_connect(host, port, timeout, &stfd)) != ERROR_SUCCESS) { if ((ret = srs_socket_connect(host, port, timeout, &stfd)) != ERROR_SUCCESS) {
srs_error("connect tcp://%s:%d failed, to=%"PRId64"ms. ret=%d", host.c_str(), port, timeout, ret); srs_error("connect tcp://%s:%d failed, to=%" PRId64 "ms. ret=%d", host.c_str(), port, timeout, ret);
return ret; return ret;
} }