From a0a2ae016107c27f97313f3388ad6e2ccbc44c09 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 18 Jun 2017 23:54:43 +0200 Subject: [PATCH] audioplayer: don't show not recognized bitrates Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9fefb133d9f46cd7a6e0811fba93398feca0913c Author: vanhofen Date: 2017-06-18 (Sun, 18 Jun 2017) Origin message was: ------------------ - audioplayer: don't show not recognized bitrates --- src/gui/audioplayer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 3c97335e4..a08aaf8ac 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1613,9 +1613,12 @@ void CAudioPlayerGui::paintItem(int pos) std::string tmp = sNr; getFileInfoToDisplay(tmp, m_playlist[currpos]); - char dura[9]; + char dura[9] = {0}; if (m_inetmode) - snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); + { + if (m_playlist[currpos].MetaData.total_time != 0) + snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); + } else snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, m_playlist[currpos].MetaData.total_time % 60); @@ -2117,7 +2120,7 @@ void CAudioPlayerGui::updateMetaData() paintCover(); } if (CAudioPlayer::getInstance()->hasMetaDataChanged() != 0) - updateLcd = true; + updateLcd = true; //printf("CAudioPlayerGui::updateMetaData: updateLcd %d\n", updateLcd); if (updateLcd)