deal with warnings

This commit is contained in:
sirius 2019-11-12 21:41:30 +08:00
parent 8c48e7d633
commit 76a80fe01b
2 changed files with 8 additions and 7 deletions

View file

@ -345,7 +345,8 @@ void CVideo::fill_video_frame()
void CVideo::read_rgb_from_gl()
{
size_t i, j, k, cur_gl, cur_rgb, nvals;
int i, j, k;
size_t cur_gl, cur_rgb, nvals;
const size_t format_nchannels = 3;
nvals = format_nchannels * m_Width * m_Height;
m_pPixels = (uint8_t *)realloc(m_pPixels, nvals * sizeof(GLubyte));
@ -359,7 +360,7 @@ void CVideo::read_rgb_from_gl()
{
cur_gl = format_nchannels * (m_Width * (m_Height - i - 1) + j);
cur_rgb = format_nchannels * (m_Width * i + j);
for (k = 0; k < format_nchannels; k++)
for (k = 0; k < (int)format_nchannels; k++)
m_pRGB[cur_rgb + k] = m_pPixels[cur_gl + k];
}
}
@ -643,7 +644,7 @@ void CVideo::add_stream(OutputStream *ost, AVFormatContext *oc, AVCodec **codec,
void CVideo::write_frame(OutputStream* pStream)
{
int ret_send, ret_recv = 0;
int ret_recv = 0;
AVPacket Packet = { 0 };
@ -651,7 +652,7 @@ void CVideo::write_frame(OutputStream* pStream)
Packet.data = 0;
Packet.size = 0;
ret_send = avcodec_send_frame(pStream->enc, pStream->frame);
avcodec_send_frame(pStream->enc, pStream->frame);
do
{
ret_recv = avcodec_receive_packet(pStream->enc, &Packet);
@ -681,7 +682,7 @@ void CVideo::write_frame(OutputStream* pStream)
void CVideo::finish_frames(OutputStream* pStream)
{
dbg_msg("video_recorder", "------------");
int ret_send, ret_recv = 0;
int ret_recv = 0;
AVPacket Packet = { 0 };
@ -689,7 +690,7 @@ void CVideo::finish_frames(OutputStream* pStream)
Packet.data = 0;
Packet.size = 0;
ret_send = avcodec_send_frame(pStream->enc, 0);
avcodec_send_frame(pStream->enc, 0);
do
{
ret_recv = avcodec_receive_packet(pStream->enc, &Packet);

View file

@ -69,7 +69,7 @@ public:
static IVideo* Current() { return IVideo::ms_pCurrentVideo; }
static void Init() { av_log_set_level(AV_LOG_DEBUG); avcodec_register_all(); av_register_all(); }
static void Init() { av_log_set_level(AV_LOG_DEBUG); }
private:
void fill_video_frame();