全面整理代码,去除编译警告

This commit is contained in:
xia-chu
2021-01-17 18:31:50 +08:00
parent fb1e35a39a
commit b6cbc87712
272 changed files with 936 additions and 933 deletions

View File

@@ -1,7 +1,7 @@
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
*
* Use of this source code is governed by MIT license that can be found in the
* LICENSE file in the root of the source tree. All contributing project authors
@@ -50,7 +50,7 @@ void HlsMakerImp::clearCache() {
}
}
string HlsMakerImp::onOpenSegment(int index) {
string HlsMakerImp::onOpenSegment(uint64_t index) {
string segment_name, segment_path;
{
auto strDate = getTimeStr("%Y-%m-%d");
@@ -79,7 +79,7 @@ string HlsMakerImp::onOpenSegment(int index) {
return segment_name + "?" + _params;
}
void HlsMakerImp::onDelSegment(int index) {
void HlsMakerImp::onDelSegment(uint64_t index) {
auto it = _segment_file_paths.find(index);
if (it == _segment_file_paths.end()) {
return;
@@ -88,7 +88,7 @@ void HlsMakerImp::onDelSegment(int index) {
_segment_file_paths.erase(it);
}
void HlsMakerImp::onWriteSegment(const char *data, int len) {
void HlsMakerImp::onWriteSegment(const char *data, size_t len) {
if (_file) {
fwrite(data, len, 1, _file.get());
}
@@ -97,7 +97,7 @@ void HlsMakerImp::onWriteSegment(const char *data, int len) {
}
}
void HlsMakerImp::onWriteHls(const char *data, int len) {
void HlsMakerImp::onWriteHls(const char *data, size_t len) {
auto hls = makeFile(_path_hls);
if (hls) {
fwrite(data, len, 1, hls.get());
@@ -116,7 +116,7 @@ void HlsMakerImp::onFlushLastSegment(uint32_t duration_ms) {
if (broadcastRecordTs) {
//关闭ts文件以便获取正确的文件大小
_file = nullptr;
_info.time_len = duration_ms / 1000.0;
_info.time_len = duration_ms / 1000.0f;
struct stat fileData;
stat(_info.file_path.data(), &fileData);
_info.file_size = fileData.st_size;