player_thread: pass format to audio_output_all_open() after resume
When playback is unpaused, pass the audio_format to audio_output_all_open(). Don't assume that output_all.c remembers the previous audio format. Also check if there has been an audio format yet.
This commit is contained in:
@@ -333,8 +333,12 @@ static void player_process_command(struct player *player)
|
|||||||
if (player->paused) {
|
if (player->paused) {
|
||||||
audio_output_all_pause();
|
audio_output_all_pause();
|
||||||
pc.state = PLAYER_STATE_PAUSE;
|
pc.state = PLAYER_STATE_PAUSE;
|
||||||
} else {
|
} else if (!audio_format_defined(&player->play_audio_format)) {
|
||||||
if (audio_output_all_open(NULL, player_buffer)) {
|
/* the decoder hasn't provided an audio format
|
||||||
|
yet - don't open the audio device yet */
|
||||||
|
|
||||||
|
pc.state = PLAYER_STATE_PLAY;
|
||||||
|
} else if (audio_output_all_open(&player->play_audio_format, player_buffer)) {
|
||||||
pc.state = PLAYER_STATE_PLAY;
|
pc.state = PLAYER_STATE_PLAY;
|
||||||
} else {
|
} else {
|
||||||
assert(dc.next_song == NULL || dc.next_song->url != NULL);
|
assert(dc.next_song == NULL || dc.next_song->url != NULL);
|
||||||
@@ -343,7 +347,7 @@ static void player_process_command(struct player *player)
|
|||||||
|
|
||||||
player->paused = true;
|
player->paused = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
player_command_finished();
|
player_command_finished();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user