aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-04-08 22:00:35 +0200
committerMax Kellermann <max@duempel.org>2013-04-08 22:00:35 +0200
commitcd71038655677878205a9532dd91667c5ac8b1b8 (patch)
tree7f422663245d58a41dec12de73467957c2a85706
parent1894aed26142c919e49289e9e154673f658d955c (diff)
downloadmpd-cd71038655677878205a9532dd91667c5ac8b1b8.tar.gz
mpd-cd71038655677878205a9532dd91667c5ac8b1b8.tar.xz
mpd-cd71038655677878205a9532dd91667c5ac8b1b8.zip
command: don't check audio_format if not playing
Fixes valgrind warning.
Diffstat (limited to '')
-rw-r--r--src/command.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/command.c b/src/command.c
index 472571006..34ec87247 100644
--- a/src/command.c
+++ b/src/command.c
@@ -381,7 +381,7 @@ handle_status(struct client *client,
song, playlist_get_song_id(&g_playlist, song));
}
- if (player_status.state != PLAYER_STATE_STOP)
+ if (player_status.state != PLAYER_STATE_STOP) {
client_printf(client,
COMMAND_STATUS_TIME ": %i:%i\n"
"elapsed: %1.3f\n"
@@ -391,13 +391,14 @@ handle_status(struct client *client,
player_status.elapsed_time,
player_status.bit_rate);
- if (audio_format_defined(&player_status.audio_format)) {
- struct audio_format_string af_string;
+ if (audio_format_defined(&player_status.audio_format)) {
+ struct audio_format_string af_string;
- client_printf(client,
- COMMAND_STATUS_AUDIO ": %s\n",
- audio_format_to_string(&player_status.audio_format,
- &af_string));
+ client_printf(client,
+ COMMAND_STATUS_AUDIO ": %s\n",
+ audio_format_to_string(&player_status.audio_format,
+ &af_string));
+ }
}
if ((updateJobId = isUpdatingDB())) {