mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 06:40:15 +00:00
Fixed some Windows warnings
This commit is contained in:
@@ -614,7 +614,7 @@ static void audio_update_recv_buf(struct state_audio *s, size_t curr_frame_len)
|
||||
|
||||
if (new_size > s->recv_buf_size) {
|
||||
s->recv_buf_size = new_size;
|
||||
debug_msg("[Audio receiver] Recv buffer adjusted to %zd\n", new_size);
|
||||
debug_msg("[Audio receiver] Recv buffer adjusted to %zu\n", new_size);
|
||||
rtp_set_recv_buf(s->audio_network_device, s->recv_buf_size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,18 +213,6 @@ void keyboard_control::stop()
|
||||
#define GETCH getch
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Input must be 0x80-0xff
|
||||
*/
|
||||
static int count_utf8_bytes(unsigned int i) {
|
||||
int count = 0;
|
||||
while ((i & 0x80) != 0u) {
|
||||
count++;
|
||||
i <<= 1;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
#define CHECK_EOF(x) do { if (x == EOF) { LOG(LOG_LEVEL_WARNING) << MOD_NAME "Unexpected EOF detected!\n"; return EOF; } } while(0)
|
||||
|
||||
/**
|
||||
@@ -273,6 +261,18 @@ static int64_t get_ansi_code() {
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
/*
|
||||
* Input must be 0x80-0xff
|
||||
*/
|
||||
static int count_utf8_bytes(unsigned int i) {
|
||||
int count = 0;
|
||||
while ((i & 0x80) != 0u) {
|
||||
count++;
|
||||
i <<= 1;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
static int64_t get_utf8_code(int c) {
|
||||
if (c < 0xc0) {
|
||||
LOG(LOG_LEVEL_WARNING) << MOD_NAME "Wrong UTF sequence!\n";
|
||||
|
||||
@@ -1565,7 +1565,7 @@ static audio_frame *process_new_audio_packets(struct vidcap_decklink_state *s) {
|
||||
LOG(LOG_LEVEL_WARNING) << "[DeckLink] Audio frame too small!\n";
|
||||
}
|
||||
} else {
|
||||
if (s->audio.data_len + audioPacket->GetSampleFrameCount() * s->audio.ch_count * s->audio.bps <= static_cast<unsigned>(s->audio.max_size)) {
|
||||
if (s->audio.data_len + audioPacket->GetSampleFrameCount() * s->audio.ch_count * s->audio.bps <= s->audio.max_size) {
|
||||
memcpy(s->audio.data + s->audio.data_len, audioFrame, audioPacket->GetSampleFrameCount() * s->audio.ch_count * s->audio.bps);
|
||||
s->audio.data_len = min<int64_t>(s->audio.data_len + audioPacket->GetSampleFrameCount() * s->audio.ch_count * s->audio.bps, INT_MAX);
|
||||
} else {
|
||||
|
||||
@@ -435,7 +435,7 @@ static int vidcap_testcard_init(struct vidcap_params *params, void **state)
|
||||
assert(filesize >= 0);
|
||||
fseek(in, 0L, SEEK_SET);
|
||||
|
||||
if (s->frame->tiles[0].data_len != filesize) {
|
||||
if (s->frame->tiles[0].data_len != static_cast<unsigned>(filesize)) {
|
||||
int level = s->frame->tiles[0].data_len < filesize ? LOG_LEVEL_WARNING : LOG_LEVEL_ERROR;
|
||||
LOG(level) << MOD_NAME << "Wrong file size for selected "
|
||||
"resolution and codec. File size " << filesize << ", "
|
||||
|
||||
@@ -677,7 +677,7 @@ static void screenshot(struct video_frame *frame)
|
||||
time_ptr = &time_tmp;
|
||||
#endif
|
||||
|
||||
strftime(name, sizeof(name), "screenshot-%a, %d %b %Y %T %z.pnm",
|
||||
strftime(name, sizeof(name), "screenshot-%a, %d %b %Y %H:%M:%S %z.pnm",
|
||||
time_ptr);
|
||||
if (save_video_frame_as_pnm(frame, name)) {
|
||||
log_msg(LOG_LEVEL_NOTICE, MOD_NAME "Generated screenshot \"%s\".\n", name);
|
||||
|
||||
Reference in New Issue
Block a user