mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
[Feature] lastfm_scrobbler don't return to plugin on WPS resume failure
if resume playback on start was set and there was nothing to resume the menu was entered Change-Id: Iab5f48e94f3de68091cf42781d6e3ab4575c1a84
This commit is contained in:
parent
75befe19ef
commit
3c89adbdbd
1 changed files with 11 additions and 1 deletions
|
|
@ -136,6 +136,7 @@ void play_tone(unsigned int frequency, unsigned int duration);
|
||||||
static struct
|
static struct
|
||||||
{
|
{
|
||||||
bool exiting; /* signal to the thread that we want to exit */
|
bool exiting; /* signal to the thread that we want to exit */
|
||||||
|
bool hide_reentry; /* we may return on WPS fail, hide next invocation */
|
||||||
unsigned int id; /* worker thread id */
|
unsigned int id; /* worker thread id */
|
||||||
struct event_queue queue; /* thread event queue */
|
struct event_queue queue; /* thread event queue */
|
||||||
struct queue_sender_list queue_send;
|
struct queue_sender_list queue_send;
|
||||||
|
|
@ -841,6 +842,13 @@ static int plugin_exit_tsr(bool reenter)
|
||||||
"Quit scrobbler?" }, 3
|
"Quit scrobbler?" }, 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (gThread.hide_reentry &&
|
||||||
|
(rb->audio_status() & (AUDIO_STATUS_PLAY | AUDIO_STATUS_PAUSE)) == 0)
|
||||||
|
{
|
||||||
|
gThread.hide_reentry = false;
|
||||||
|
return PLUGIN_TSR_CONTINUE;
|
||||||
|
}
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
int result = reenter ? rb->do_menu(&menu, NULL, NULL, false) : 2;
|
int result = reenter ? rb->do_menu(&menu, NULL, NULL, false) : 2;
|
||||||
|
|
@ -897,8 +905,10 @@ static int plugin_main(const void* parameter)
|
||||||
rb->memcpy(&gConfig, &cfg, sizeof(struct scrobbler_cfg)); /*restore settings */
|
rb->memcpy(&gConfig, &cfg, sizeof(struct scrobbler_cfg)); /*restore settings */
|
||||||
|
|
||||||
if (gConfig.playback)
|
if (gConfig.playback)
|
||||||
|
{
|
||||||
|
gThread.hide_reentry = true;
|
||||||
return PLUGIN_GOTO_WPS;
|
return PLUGIN_GOTO_WPS;
|
||||||
|
}
|
||||||
return PLUGIN_OK;
|
return PLUGIN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue