aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-04-08 21:30:32 +0200
committerMax Kellermann <max@duempel.org>2013-04-08 21:31:03 +0200
commita30eb194d5c5188a0e824e72ce959677d5801c0a (patch)
tree40d6ffc084d0e12c2f71870e58c20758a17dbd0c
parente0c2c77c2ab1fcd65b18a4c8c71b34b2b8652900 (diff)
downloadmpd-a30eb194d5c5188a0e824e72ce959677d5801c0a.tar.gz
mpd-a30eb194d5c5188a0e824e72ce959677d5801c0a.tar.xz
mpd-a30eb194d5c5188a0e824e72ce959677d5801c0a.zip
command: don't print undefined audio_format
Check audio_format_defined().
-rw-r--r--src/command.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/command.c b/src/command.c
index c405925f2..472571006 100644
--- a/src/command.c
+++ b/src/command.c
@@ -381,18 +381,21 @@ handle_status(struct client *client,
song, playlist_get_song_id(&g_playlist, song));
}
- if (player_status.state != PLAYER_STATE_STOP) {
- struct audio_format_string af_string;
-
+ if (player_status.state != PLAYER_STATE_STOP)
client_printf(client,
COMMAND_STATUS_TIME ": %i:%i\n"
"elapsed: %1.3f\n"
- COMMAND_STATUS_BITRATE ": %u\n"
- COMMAND_STATUS_AUDIO ": %s\n",
+ COMMAND_STATUS_BITRATE ": %u\n",
(int)(player_status.elapsed_time + 0.5),
(int)(player_status.total_time + 0.5),
player_status.elapsed_time,
- player_status.bit_rate,
+ player_status.bit_rate);
+
+ 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));
}