(Android) Fix - restore state functionality broke again due to

'refactor' in driver.c - this does not work for re-entrancy - please
consult with me
This commit is contained in:
twinaphex 2012-12-24 18:06:51 +01:00
parent 70b5007a1e
commit e8a57f21cd
2 changed files with 26 additions and 34 deletions

View File

@ -139,7 +139,6 @@ void engine_handle_cmd(struct android_app* android_app, int32_t cmd)
/* POSTEXEC */
free_saved_state(android_app);
g_extern.lifecycle_state &= ~(1ULL << RARCH_PAUSE_TOGGLE);
break;
case APP_CMD_START:
RARCH_LOG("engine_handle_cmd: APP_CMD_START.\n");
@ -209,6 +208,7 @@ void engine_handle_cmd(struct android_app* android_app, int32_t cmd)
case APP_CMD_GAINED_FOCUS:
RARCH_LOG("engine_handle_cmd: APP_CMD_GAINED_FOCUS.\n");
g_extern.lifecycle_state &= ~(1ULL << RARCH_PAUSE_TOGGLE);
/* EXEC */
break;
case APP_CMD_LOST_FOCUS:
@ -229,16 +229,9 @@ void engine_handle_cmd(struct android_app* android_app, int32_t cmd)
bool android_run_events(struct android_app* android_app)
{
// Read all pending events.
int id;
int id = ALooper_pollOnce(0, NULL, 0, NULL);
RARCH_LOG("RetroArch Android paused.\n");
// Block forever waiting for events.
while ((id = ALooper_pollOnce(input_key_pressed_func(RARCH_PAUSE_TOGGLE) ? -1 : 100, NULL, 0, NULL)) >= 0)
{
// Process this event.
if (id)
if (id == LOOPER_ID_MAIN)
{
int8_t cmd;
@ -265,9 +258,6 @@ bool android_run_events(struct android_app* android_app)
// Check if we are exiting.
if (g_extern.lifecycle_state & (1ULL << RARCH_QUIT_KEY))
return false;
}
RARCH_LOG("RetroArch Android unpaused.\n");
return true;
}

View File

@ -238,8 +238,10 @@ static void adjust_system_rates(void)
RARCH_LOG("Set audio input rate to: %.2f Hz.\n", g_settings.audio.in_rate);
#ifndef ANDROID
if (driver.video_data)
video_set_nonblock_state_func(!g_settings.video.vsync || g_extern.system.force_nonblock);
#endif
}
void driver_set_monitor_refresh_rate(float hz)