mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-10-10 08:03:04 -04:00
hiby: r3proii: fix crash on playback when no headphones are detected
0 is an invalid value to set on Hiby as "Output Port Switch". For devices with multiple outputs, we need to ensure it is set to a valid port. Change-Id: I16ea2e620fae3034dccf3267d316924d8e2c0a95
This commit is contained in:
parent
c35271a3f0
commit
8923f479d0
1 changed files with 6 additions and 0 deletions
|
|
@ -86,6 +86,12 @@ void hiby_set_output(int ps)
|
|||
{
|
||||
if (!hw_init || muted) return;
|
||||
|
||||
// Default to headset if nothing was ever inserted; otherwise, R3 Pro II crashes on playback
|
||||
if (ps == 0)
|
||||
{
|
||||
ps = last_ps > 0 ? last_ps : 2;
|
||||
}
|
||||
|
||||
if (last_ps != ps)
|
||||
{
|
||||
logf("set out %d/%d", ps, last_ps);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue