mirror of
https://github.com/Rockbox/rockbox.git
synced 2026-07-10 13:29:52 -04:00
usb: iap: workaround cur/set freq mismatch
Change-Id: I75a36c9dfd33e7f9192101220633137e5ad98411
This commit is contained in:
parent
0fc352da0f
commit
7154fcd9a8
1 changed files with 10 additions and 0 deletions
|
|
@ -260,6 +260,16 @@ bool iap_audio_set_sampr(uint32_t sampr) {
|
|||
}
|
||||
}
|
||||
check_act(freq < ARRAYLEN(samprs), return false);
|
||||
|
||||
if(set_freq >= 0 && freq != set_freq) {
|
||||
/* Accessories should only set the frequency we requested via
|
||||
* TrackNewAudioAttributes, but in some cases, USB control requests may arrive late,
|
||||
* breaking established cur_freq == set_freq.
|
||||
* Ignoring sets of frequencies that were not requested can work around this. */
|
||||
ERROR("wrong frequency set: expected=%d got=%d", set_freq, freq);
|
||||
return true;
|
||||
}
|
||||
|
||||
cur_freq = freq;
|
||||
|
||||
LOG("sampr=%lu, set_freq=%d cur_freq=%d", sampr, set_freq, cur_freq);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue