From b1c429e6fb9a2f6881af2c2dd48cfb17c4477fc4 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Fri, 17 Oct 2003 14:49:00 +0000 Subject: Car Ignition Auto Stop (patch #736339 by Craig Sather) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3976 a1c6a512-1295-4272-9138-f99709370657 --- apps/wps.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'apps/wps.c') diff --git a/apps/wps.c b/apps/wps.c index f34ec81d9c..c76d7ade26 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -653,14 +653,22 @@ int wps_show(void) restore = true; } - if (mpeg_status() & MPEG_STATUS_PAUSE) { - paused = true; - } else { - paused = false; - } - while ( 1 ) { + /* did someone else (i.e power thread) change mpeg pause mode? */ + if (paused != (mpeg_status() & MPEG_STATUS_PAUSE)) { + paused = mpeg_status() & MPEG_STATUS_PAUSE; + status_set_playmode(paused ? STATUS_PAUSE : STATUS_PLAY); + + /* if another thread paused mpeg, we are probably in car mode, + about to shut down. lets save the settings. */ + if (paused && global_settings.resume) { + settings_save(); +#ifndef HAVE_RTC + ata_flush(); +#endif + } + } #ifdef HAVE_LCD_BITMAP /* when the peak meter is enabled we want to have a -- cgit v1.2.3