status: fix assertion failure on window resize without active mpd connection

This commit is contained in:
Andrzej Rybczak
2015-06-13 20:55:09 +02:00
parent a3d536b422
commit 310d280cef
2 changed files with 3 additions and 1 deletions

1
NEWS
View File

@@ -7,6 +7,7 @@ ncmpcpp-0.6.5 (????-??-??)
* Xiph tag DESCRIPTION is now rewritten as COMMENT when updating tags.
* Possible access of already freed memory when downloading artist info is fixed.
* Name of an item is now displayed correctly if present.
* Assertion failure when resizing terminal window with no active MPD connection is fixed.
ncmpcpp-0.6.4 (2015-05-02)

View File

@@ -557,7 +557,7 @@ void Status::Changes::elapsedTime(bool update_elapsed)
m_kbps = st.kbps();
}
if (m_player_state == MPD::psStop)
if (m_player_state == MPD::psUnknown || m_player_state == MPD::psStop)
{
if (Statusbar::isUnlocked() && Config.statusbar_visibility)
*wFooter << NC::XY(0, 1) << wclrtoeol;
@@ -565,6 +565,7 @@ void Status::Changes::elapsedTime(bool update_elapsed)
}
std::string ps = playerStateToString(m_player_state);
MPD::Song np = myPlaylist->nowPlayingSong();
drawTitle(np);