command: don't check audio_format if not playing

Fixes valgrind warning.
This commit is contained in:
Max Kellermann 2013-04-08 22:00:35 +02:00
parent 1894aed261
commit cd71038655

View File

@ -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())) {