From f600bf437c353b8e1f71eff7e6ca24799c693055 Mon Sep 17 00:00:00 2001 From: Themaister Date: Wed, 30 May 2012 01:20:14 +0200 Subject: [PATCH] Move message queue out of RetroArch core's control. --- general.h | 1 + retroarch.c | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/general.h b/general.h index 0deca7841a..40c75fe97a 100644 --- a/general.h +++ b/general.h @@ -482,6 +482,7 @@ bool rarch_main_iterate(void); void rarch_main_deinit(void); void rarch_render_cached_frame(void); void rarch_init_msg_queue(void); +void rarch_deinit_msg_queue(void); void rarch_load_state(void); void rarch_save_state(void); diff --git a/retroarch.c b/retroarch.c index 3311ee1333..0589e19257 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1148,7 +1148,12 @@ static void init_recording(void) params.fb_height = next_pow2(max_height); } - RARCH_LOG("Recording with FFmpeg to %s @ %ux%u. (FB size: %ux%u 32-bit: %s)\n", g_extern.record_path, params.out_width, params.out_height, params.fb_width, params.fb_height, params.rgb32 ? "yes" : "no"); + RARCH_LOG("Recording with FFmpeg to %s @ %ux%u. (FB size: %ux%u 32-bit: %s)\n", + g_extern.record_path, + params.out_width, params.out_height, + params.fb_width, params.fb_height, + params.rgb32 ? "yes" : "no"); + g_extern.rec = ffemu_new(¶ms); if (!g_extern.rec) { @@ -1175,7 +1180,7 @@ void rarch_init_msg_queue(void) rarch_assert(g_extern.msg_queue = msg_queue_new(8)); } -static void deinit_msg_queue(void) +void rarch_deinit_msg_queue(void) { if (g_extern.msg_queue) { @@ -2359,7 +2364,6 @@ int rarch_main_init(int argc, char *argv[]) goto error; init_system_av_info(); - rarch_init_msg_queue(); if (!g_extern.sram_load_disable) load_save_files(); @@ -2539,7 +2543,6 @@ void rarch_main_deinit(void) #ifdef HAVE_BSV_MOVIE deinit_movie(); #endif - deinit_msg_queue(); pretro_unload_game(); pretro_deinit(); @@ -2553,8 +2556,10 @@ int main(int argc, char *argv[]) { int init_ret; if ((init_ret = rarch_main_init(argc, argv))) return init_ret; + rarch_init_msg_queue(); while (rarch_main_iterate()); rarch_main_deinit(); + rarch_deinit_msg_queue(); rarch_main_clear_state(); return 0; }