forked from len0rd/rockbox
Fix FS 8753, JdGordon started it, I finished it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16692 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6d8b827472
commit
7b1de20544
1 changed files with 21 additions and 10 deletions
13
apps/misc.c
13
apps/misc.c
|
|
@ -862,14 +862,24 @@ void car_adapter_mode_init(void)
|
|||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
static void unplug_change(bool inserted)
|
||||
{
|
||||
static bool headphone_caused_pause = false;
|
||||
|
||||
if (global_settings.unplug_mode)
|
||||
{
|
||||
int audio_stat = audio_status();
|
||||
if (inserted)
|
||||
{
|
||||
if ( global_settings.unplug_mode > 1 )
|
||||
if ((audio_stat & AUDIO_STATUS_PLAY) &&
|
||||
headphone_caused_pause &&
|
||||
global_settings.unplug_mode > 1 )
|
||||
audio_resume();
|
||||
backlight_on();
|
||||
headphone_caused_pause = false;
|
||||
} else {
|
||||
if ((audio_stat & AUDIO_STATUS_PLAY) &&
|
||||
!(audio_stat & AUDIO_STATUS_PAUSE))
|
||||
{
|
||||
headphone_caused_pause = true;
|
||||
audio_pause();
|
||||
|
||||
if (global_settings.unplug_rw)
|
||||
|
|
@ -884,6 +894,7 @@ static void unplug_change(bool inserted)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
long default_event_handler_ex(long event, void (*callback)(void *), void *parameter)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue