forked from len0rd/rockbox
Headphone / lineout pause/resume #FS13237
Allow Lineout to behave like headphone port in regards to plug/unplug pause/resume Change-Id: I9cb2c9c40e0bdf3bf7e1e272164acd343f6b3850
This commit is contained in:
parent
4fa945d810
commit
2df3a5b04c
6 changed files with 56 additions and 13 deletions
|
|
@ -169,10 +169,19 @@ int audio_get_spdif_sample_rate(void)
|
|||
#ifdef HAVE_SPEAKER
|
||||
void audio_enable_speaker(int mode)
|
||||
{
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
#if defined(HAVE_HEADPHONE_DETECTION) || defined(HAVE_LINEOUT_DETECTION)
|
||||
/* if needed, query jack state */
|
||||
if(mode == 2)
|
||||
mode = !headphones_inserted();
|
||||
{
|
||||
#ifdef HAVE_HEADPHONE_DETECTION
|
||||
if (headphones_inserted())
|
||||
mode = 0;
|
||||
#endif
|
||||
#ifdef HAVE_LINEOUT_DETECTION
|
||||
if (lineout_inserted())
|
||||
mode = 0;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
/* treat any nonzero value as enable */
|
||||
audiohw_enable_speaker(mode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue