Commit ab3d7c29 authored by Max Kellermann's avatar Max Kellermann

player_thread: don't open audio device when paused

When a PAUSE command is received while the decoder starts, don't open the audio device when the decoder becomes ready. It's pointless, because MPD will close if after that.
parent e1bd2c65
...@@ -179,7 +179,8 @@ player_check_decoder_startup(struct player *player) ...@@ -179,7 +179,8 @@ player_check_decoder_startup(struct player *player)
/* the decoder is ready and ok */ /* the decoder is ready and ok */
player->decoder_starting = false; player->decoder_starting = false;
if (!audio_output_all_open(&dc.out_audio_format)) { if (!player->paused &&
!audio_output_all_open(&dc.out_audio_format)) {
char *uri = song_get_uri(dc.next_song); char *uri = song_get_uri(dc.next_song);
g_warning("problems opening audio device " g_warning("problems opening audio device "
"while playing \"%s\"", uri); "while playing \"%s\"", uri);
...@@ -191,9 +192,6 @@ player_check_decoder_startup(struct player *player) ...@@ -191,9 +192,6 @@ player_check_decoder_startup(struct player *player)
return false; return false;
} }
if (player->paused)
audio_output_all_close();
pc.total_time = dc.total_time; pc.total_time = dc.total_time;
pc.audio_format = dc.in_audio_format; pc.audio_format = dc.in_audio_format;
player->play_audio_format = dc.out_audio_format; player->play_audio_format = dc.out_audio_format;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment