修复编译警告

This commit is contained in:
xia-chu
2026-01-08 21:18:00 +08:00
parent 48c37d4f46
commit a59809047c
12 changed files with 18 additions and 19 deletions

View File

@@ -57,7 +57,7 @@ public:
toolkit::Buffer::Ptr getExtraData() const override;
void setExtraData(const uint8_t *data, size_t size) override;
protected:
aom_av1_t _context = {0};
aom_av1_t _context {};
};
} // namespace mediakit

View File

@@ -20,7 +20,7 @@ using namespace toolkit;
namespace mediakit {
Buffer::Ptr G711Track::getExtraData() const {
struct wave_format_t wav = {0};
struct wave_format_t wav {};
wav.wFormatTag = getCodecId() == CodecG711A ? WAVE_FORMAT_ALAW : WAVE_FORMAT_MULAW;
wav.nChannels = getAudioChannel();
wav.nSamplesPerSec = getAudioSampleRate();

View File

@@ -28,7 +28,7 @@ void OpusTrack::setExtraData(const uint8_t *data, size_t size) {
}
Buffer::Ptr OpusTrack::getExtraData() const {
struct opus_head_t opus = { 0 };
struct opus_head_t opus {};
opus.version = 1;
opus.channels = getAudioChannel();
opus.input_sample_rate = getAudioSampleRate();

View File

@@ -41,7 +41,7 @@ public:
toolkit::Buffer::Ptr getExtraData() const override;
void setExtraData(const uint8_t *data, size_t size) override;
private:
webm_vpx_t _vpx = {0};
webm_vpx_t _vpx {};
};
} // namespace mediakit

View File

@@ -334,7 +334,7 @@ bool VP8RtpEncoder::inputFrame(const Frame::Ptr &frame) {
bool key = frame->keyFrame();
bool mark = false;
for (size_t pos = 0; pos < len; pos += pdu_size) {
if (len - pos <= pdu_size) {
if (static_cast<int>(len - pos) <= pdu_size) {
pdu_size = len - pos;
mark = true;
}

View File

@@ -56,9 +56,6 @@ public:
using Ptr = std::shared_ptr<VP8RtpEncoder>;
bool inputFrame(const Frame::Ptr &frame) override;
private:
uint16_t _pic_id = 0;
};
}//namespace mediakit

View File

@@ -41,7 +41,7 @@ public:
toolkit::Buffer::Ptr getExtraData() const override;
void setExtraData(const uint8_t *data, size_t size) override;
private:
webm_vpx_t _vpx = {0};
webm_vpx_t _vpx {};
};
} // namespace mediakit

View File

@@ -297,7 +297,7 @@ bool VP9RtpEncoder::inputFrame(const Frame::Ptr &frame) {
int pdu_size = getRtpInfo().getMaxSize() - nheader;
bool mark = false;
for (size_t pos = 0; pos < len; pos += pdu_size) {
for (int pos = 0; pos < len; pos += pdu_size) {
if (len - pos <= pdu_size) {
pdu_size = len - pos;
header[0] |= kEBit;