mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 05:35:02 -05:00
usbaudio: triage panic from splash()
Do the check in gui_wps_show() to avoid calling splash() from anything other than the main thread Change-Id: Icc1c6f287d82dc6e73b7cae9c75c18be73b82d48
This commit is contained in:
parent
bc7bc4e8ac
commit
896cceee24
2 changed files with 16 additions and 2 deletions
|
|
@ -65,6 +65,10 @@
|
||||||
#include "skin_engine/wps_internals.h"
|
#include "skin_engine/wps_internals.h"
|
||||||
#include "open_plugin.h"
|
#include "open_plugin.h"
|
||||||
|
|
||||||
|
#ifdef USB_ENABLE_AUDIO
|
||||||
|
#include "usbstack/usb_audio.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */
|
#define FF_REWIND_MAX_PERCENT 3 /* cap ff/rewind step size at max % of file */
|
||||||
/* 3% of 30min file == 54s step size */
|
/* 3% of 30min file == 54s step size */
|
||||||
#define MIN_FF_REWIND_STEP 500
|
#define MIN_FF_REWIND_STEP 500
|
||||||
|
|
@ -713,6 +717,13 @@ static inline int action_wpsab_single(long button)
|
||||||
*/
|
*/
|
||||||
long gui_wps_show(void)
|
long gui_wps_show(void)
|
||||||
{
|
{
|
||||||
|
/* NOTE: if USBAudio ever gets its own DSP channel, this block can go away! */
|
||||||
|
#ifdef USB_ENABLE_AUDIO
|
||||||
|
if (usb_audio_get_active())
|
||||||
|
{
|
||||||
|
splash(HZ*2, ID2P(LANG_USB_DAC_ACTIVE));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
long button = 0;
|
long button = 0;
|
||||||
bool restore = true;
|
bool restore = true;
|
||||||
bool exit = false;
|
bool exit = false;
|
||||||
|
|
|
||||||
|
|
@ -2984,11 +2984,14 @@ static void audio_on_track_changed(void)
|
||||||
static void audio_start_playback(const struct audio_resume_info *resume_info,
|
static void audio_start_playback(const struct audio_resume_info *resume_info,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
/* NOTE: if USBAudio ever gets its own DSP channel, this block can go away! */
|
/*
|
||||||
|
* Refuse to start playback if usb audio is active. See gui_wps_show() for
|
||||||
|
* a splash message to the user.
|
||||||
|
* NOTE: if USBAudio ever gets its own DSP channel, this block can go away!
|
||||||
|
*/
|
||||||
#ifdef USB_ENABLE_AUDIO
|
#ifdef USB_ENABLE_AUDIO
|
||||||
if (usb_audio_get_active())
|
if (usb_audio_get_active())
|
||||||
{
|
{
|
||||||
splash(HZ*2, ID2P(LANG_USB_DAC_ACTIVE));
|
|
||||||
queue_reply(&audio_queue, 0);
|
queue_reply(&audio_queue, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue