diff options
author | Max Kellermann <max@duempel.org> | 2009-03-10 21:00:52 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-03-10 21:00:52 +0100 |
commit | d3eccb2324050b74fe8d6db0747ffdda035b6075 (patch) | |
tree | 3ba089a73ecacd7f895b372d493466c290650a81 /src | |
parent | a790b645688ab471301eae3eda4d8d9f3a0deba4 (diff) | |
download | mpd-d3eccb2324050b74fe8d6db0747ffdda035b6075.tar.gz mpd-d3eccb2324050b74fe8d6db0747ffdda035b6075.tar.xz mpd-d3eccb2324050b74fe8d6db0747ffdda035b6075.zip |
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.
Diffstat (limited to '')
-rw-r--r-- | src/player_thread.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/player_thread.c b/src/player_thread.c index 523e6fe3f..a41fc5c01 100644 --- a/src/player_thread.c +++ b/src/player_thread.c @@ -333,17 +333,21 @@ static void player_process_command(struct player *player) if (player->paused) { audio_output_all_pause(); pc.state = PLAYER_STATE_PAUSE; + } else if (!audio_format_defined(&player->play_audio_format)) { + /* 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; } else { - if (audio_output_all_open(NULL, player_buffer)) { - pc.state = PLAYER_STATE_PLAY; - } else { - assert(dc.next_song == NULL || dc.next_song->url != NULL); - pc.errored_song = dc.next_song; - pc.error = PLAYER_ERROR_AUDIO; + assert(dc.next_song == NULL || dc.next_song->url != NULL); + pc.errored_song = dc.next_song; + pc.error = PLAYER_ERROR_AUDIO; - player->paused = true; - } + player->paused = true; } + player_command_finished(); break; |