player: don't call STOP before CLOSE_AUDIO
playerWait() stops the player thread (twice!) and closes the output device. It should be well enough to just send CLOSE_AUDIO, without STOP. This requires a tiny change to the player thread code: make it break when CLOSE_AUDIO is sent.
This commit is contained in:
parent
cff923b9d8
commit
92d9797b8c
22
src/player.c
22
src/player.c
@ -25,14 +25,6 @@
|
|||||||
#include "os_compat.h"
|
#include "os_compat.h"
|
||||||
#include "main_notify.h"
|
#include "main_notify.h"
|
||||||
|
|
||||||
static void playerCloseAudio(void);
|
|
||||||
|
|
||||||
void playerWait(void)
|
|
||||||
{
|
|
||||||
playerStop();
|
|
||||||
playerCloseAudio();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void set_current_song(Song *song)
|
static void set_current_song(Song *song)
|
||||||
{
|
{
|
||||||
assert(song != NULL);
|
assert(song != NULL);
|
||||||
@ -76,6 +68,14 @@ void playerStop(void)
|
|||||||
playerQueueUnlock();
|
playerQueueUnlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void playerWait(void)
|
||||||
|
{
|
||||||
|
player_command(PLAYER_COMMAND_CLOSE_AUDIO);
|
||||||
|
|
||||||
|
pc.queueState = PLAYER_QUEUE_BLANK;
|
||||||
|
playerQueueUnlock();
|
||||||
|
}
|
||||||
|
|
||||||
void playerKill(void) /* deprecated */
|
void playerKill(void) /* deprecated */
|
||||||
{
|
{
|
||||||
playerPause();
|
playerPause();
|
||||||
@ -165,12 +165,6 @@ char *getPlayerErrorStr(void)
|
|||||||
return *error ? error : NULL;
|
return *error ? error : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void playerCloseAudio(void)
|
|
||||||
{
|
|
||||||
playerStop();
|
|
||||||
player_command(PLAYER_COMMAND_CLOSE_AUDIO);
|
|
||||||
}
|
|
||||||
|
|
||||||
int queueSong(Song * song)
|
int queueSong(Song * song)
|
||||||
{
|
{
|
||||||
if (pc.queueState == PLAYER_QUEUE_BLANK) {
|
if (pc.queueState == PLAYER_QUEUE_BLANK) {
|
||||||
|
@ -224,7 +224,8 @@ static void decodeParent(void)
|
|||||||
while (1) {
|
while (1) {
|
||||||
processDecodeInput(&do_pause, &bbp, &do_xfade,
|
processDecodeInput(&do_pause, &bbp, &do_xfade,
|
||||||
&decodeWaitedOn, &next);
|
&decodeWaitedOn, &next);
|
||||||
if (pc.command == PLAYER_COMMAND_STOP) {
|
if (pc.command == PLAYER_COMMAND_STOP ||
|
||||||
|
pc.command == PLAYER_COMMAND_CLOSE_AUDIO) {
|
||||||
dropBufferedAudio();
|
dropBufferedAudio();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user