mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 02:40:14 +00:00
Small fixes
* format string in debug * quit SDL subsystem * some assertions in src/video_frame.c to check allocation success
This commit is contained in:
@@ -109,8 +109,8 @@ void log_msg(int level, const char *format, ...)
|
||||
strcat(format_new, color);
|
||||
}
|
||||
if (log_level >= LOG_LEVEL_VERBOSE) {
|
||||
uint64_t time_ms = time_since_epoch_in_ms();
|
||||
sprintf(format_new + strlen(format_new), "[%ld.%03ld] ", time_ms / 1000,
|
||||
unsigned long long time_ms = time_since_epoch_in_ms();
|
||||
sprintf(format_new + strlen(format_new), "[%llu.%03llu] ", time_ms / 1000,
|
||||
time_ms % 1000);
|
||||
}
|
||||
strcat(format_new, format);
|
||||
|
||||
@@ -592,6 +592,7 @@ static void display_sdl_done(void *state)
|
||||
/*FIXME: free all the stuff */
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
|
||||
SDL_QuitSubSystem(SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);
|
||||
SDL_Quit();
|
||||
#ifdef HAVE_MACOSX
|
||||
autorelease_pool_destroy(s->autorelease_pool);
|
||||
|
||||
@@ -66,9 +66,11 @@ struct video_frame * vf_alloc(int count)
|
||||
assert(count > 0);
|
||||
|
||||
buf = (struct video_frame *) calloc(1, sizeof(struct video_frame));
|
||||
assert(buf != NULL);
|
||||
|
||||
buf->tiles = (struct tile *)
|
||||
calloc(1, sizeof(struct tile) * count);
|
||||
assert(buf->tiles != NULL);
|
||||
buf->tile_count = count;
|
||||
|
||||
return buf;
|
||||
@@ -108,6 +110,7 @@ struct video_frame * vf_alloc_desc_data(struct video_desc desc)
|
||||
desc.color_spec) *
|
||||
desc.height;
|
||||
buf->tiles[i].data = (char *) malloc(buf->tiles[i].data_len);
|
||||
assert(buf->tiles[i].data != NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user