From d0f710566475c72ef3c8e86bacbfbf96f03ff78f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 2 Aug 2019 00:28:53 +0200 Subject: [PATCH] webtv:add icy meta info Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/90ce4c54b61d918dc0708675cfbffef7741f2984 Author: Jacek Jendrzej Date: 2019-08-02 (Fri, 02 Aug 2019) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 53 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index de8dcccd6..b6cd4db3b 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1039,6 +1039,10 @@ bool CInfoViewer::showLivestreamInfo() // try to get meta data std::string artist = ""; std::string title = ""; + std::string icy_br; + std::string icy_genre; + std::string icy_name; + std::string icy_description; std::vector keys, values; cPlayback *playback = CMoviePlayerGui::getInstance().getPlayback(); if (playback && playback->IsPlaying()) @@ -1059,6 +1063,35 @@ bool CInfoViewer::showLivestreamInfo() title = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]); continue; } + if (!strcasecmp("StreamTitle", key.c_str())) + { + artist = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]); + continue; + } + if (!strcasecmp("icy-name", key.c_str())) + { + icy_name = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]); + continue; + } + if (!strcasecmp("icy-genre", key.c_str())) + { + icy_genre = " ("; + icy_genre += isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]); + icy_genre += ") "; + continue; + } + if (!strcasecmp("icy-br", key.c_str())) + { + icy_br = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]); + icy_br += " kb/s"; + continue; + } + if (!strcasecmp("icy-description", key.c_str())) + { + icy_description = " - "; + icy_description += isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]); + continue; + } } } if (!artist.empty()) @@ -1071,6 +1104,18 @@ bool CInfoViewer::showLivestreamInfo() livestreamInfo1 += " - "; livestreamInfo1 += title; } + if(livestreamInfo2.empty()) + { + if(!icy_name.empty()) + livestreamInfo2 = icy_name; + if(!icy_genre.empty()) + livestreamInfo2 += icy_genre; + if(!icy_br.empty()) + livestreamInfo2 += icy_br; + if(!icy_description.empty() && livestreamInfo2.empty()) + livestreamInfo2 += icy_description; + } + } if (livestreamInfo1 != _livestreamInfo1 || livestreamInfo2 != _livestreamInfo2) @@ -1094,8 +1139,8 @@ void CInfoViewer::loop(bool show_dot) setInfobarTimeout(); int res = messages_return::none; - neutrino_msg_t msg; - neutrino_msg_data_t data; + neutrino_msg_t msg = 0; + neutrino_msg_data_t data = 0; if (isVolscale) CVolume::getInstance()->showVolscale(); @@ -1357,8 +1402,8 @@ void CInfoViewer::showSubchan () uint64_t timeoutEnd_tmp = CRCInput::calcTimeoutEnd(2); int res = messages_return::none; - neutrino_msg_t msg; - neutrino_msg_data_t data; + neutrino_msg_t msg = 0; + neutrino_msg_data_t data = 0; while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) { g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd_tmp);