player_thread: pause when all audio outputs fail to play
When all audio outputs have been closed due to failures, pause the playback instead of stopping it. This way, the user may resume at the current position after the problem has been dealt with.
This commit is contained in:
parent
70faf59275
commit
472b994779
1
NEWS
1
NEWS
@ -62,6 +62,7 @@ ver 0.15 (200?/??/??)
|
|||||||
* playlist_directory and music_directory are optional
|
* playlist_directory and music_directory are optional
|
||||||
* playlist: recalculate the queued song after random is toggled
|
* playlist: recalculate the queued song after random is toggled
|
||||||
* playlist: don't unpause on delete
|
* playlist: don't unpause on delete
|
||||||
|
* pause when all audio outputs fail to play
|
||||||
* daemon: ignore "user" setting if already running as that user
|
* daemon: ignore "user" setting if already running as that user
|
||||||
* listen: fix broken client IP addresses in log
|
* listen: fix broken client IP addresses in log
|
||||||
* 24/32 bit audio support
|
* 24/32 bit audio support
|
||||||
|
@ -549,6 +549,12 @@ play_next_chunk(struct player *player)
|
|||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
music_buffer_return(player_buffer, chunk);
|
music_buffer_return(player_buffer, chunk);
|
||||||
|
|
||||||
|
/* pause: the user may resume playback as soon as an
|
||||||
|
audio output becomes available */
|
||||||
|
pc.state = PLAYER_STATE_PAUSE;
|
||||||
|
player->paused = true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -708,8 +714,7 @@ static void do_play(void)
|
|||||||
/* at least one music chunk is ready - send it
|
/* at least one music chunk is ready - send it
|
||||||
to the audio output */
|
to the audio output */
|
||||||
|
|
||||||
if (!play_next_chunk(&player))
|
play_next_chunk(&player);
|
||||||
break;
|
|
||||||
} else if (audio_output_all_check() > 0) {
|
} else if (audio_output_all_check() > 0) {
|
||||||
/* not enough data from decoder, but the
|
/* not enough data from decoder, but the
|
||||||
output thread is still busy, so it's
|
output thread is still busy, so it's
|
||||||
|
Loading…
Reference in New Issue
Block a user