修复编译警告

This commit is contained in:
ziyue 2022-01-17 10:35:29 +08:00
parent 30db79f4dd
commit 27482a5459

View File

@ -226,7 +226,7 @@ static const string kEdgeServerParam = "edge=1";
static string getPullUrl(const string &origin_fmt, const MediaInfo &info) { static string getPullUrl(const string &origin_fmt, const MediaInfo &info) {
char url[1024] = { 0 }; char url[1024] = { 0 };
if (origin_fmt.size() > snprintf(url, sizeof(url), origin_fmt.data(), info._app.data(), info._streamid.data())) { if ((ssize_t)origin_fmt.size() > snprintf(url, sizeof(url), origin_fmt.data(), info._app.data(), info._streamid.data())) {
WarnL << "get origin url failed, origin_fmt:" << origin_fmt; WarnL << "get origin url failed, origin_fmt:" << origin_fmt;
return ""; return "";
} }
@ -234,7 +234,7 @@ static string getPullUrl(const string &origin_fmt, const MediaInfo &info) {
return string(url) + '?' + kEdgeServerParam + '&' + VHOST_KEY + '=' + info._vhost + '&' + info._param_strs; return string(url) + '?' + kEdgeServerParam + '&' + VHOST_KEY + '=' + info._vhost + '&' + info._param_strs;
} }
static void pullStreamFromOrigin(const vector<string>& urls, int index, int failed_cnt, const MediaInfo &args, static void pullStreamFromOrigin(const vector<string>& urls, size_t index, size_t failed_cnt, const MediaInfo &args,
const function<void()> &closePlayer) { const function<void()> &closePlayer) {
GET_CONFIG(float, cluster_timeout_sec, Cluster::kTimeoutSec); GET_CONFIG(float, cluster_timeout_sec, Cluster::kTimeoutSec);