mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
- infoviewer: fix FIXME comment in 9b340752244980a59d57d3d318f70339a7f8d2e1
This commit is contained in:
@@ -941,17 +941,23 @@ bool CInfoViewer::showLivestreamInfo()
|
|||||||
{
|
{
|
||||||
CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel();
|
CZapitChannel * cc = CZapit::getInstance()->GetCurrentChannel();
|
||||||
bool web_mode = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv || CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webradio);
|
bool web_mode = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv || CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webradio);
|
||||||
if (web_mode && cc->getEpgID() == 0 && !cc->getScriptName().empty()) {
|
if (web_mode && cc->getEpgID() == 0)
|
||||||
|
{
|
||||||
std::string livestreamInfo1 = "";
|
std::string livestreamInfo1 = "";
|
||||||
std::string livestreamInfo2 = "";
|
std::string livestreamInfo2 = "";
|
||||||
|
|
||||||
|
if (!cc->getScriptName().empty())
|
||||||
|
{
|
||||||
std::string tmp1 = "";
|
std::string tmp1 = "";
|
||||||
CMoviePlayerGui::getInstance().getLivestreamInfo(&livestreamInfo1, &tmp1);
|
CMoviePlayerGui::getInstance().getLivestreamInfo(&livestreamInfo1, &tmp1);
|
||||||
|
|
||||||
if (!(videoDecoder->getBlank())) {
|
if (!(videoDecoder->getBlank()))
|
||||||
int xres = 0, yres = 0, framerate = 0;
|
{
|
||||||
|
int xres, yres, framerate;
|
||||||
std::string tmp2;
|
std::string tmp2;
|
||||||
videoDecoder->getPictureInfo(xres, yres, framerate);
|
videoDecoder->getPictureInfo(xres, yres, framerate);
|
||||||
switch (framerate) {
|
switch (framerate)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
tmp2 = "23.976fps";
|
tmp2 = "23.976fps";
|
||||||
break;
|
break;
|
||||||
@@ -977,7 +983,6 @@ bool CInfoViewer::showLivestreamInfo()
|
|||||||
tmp2 = "60fps";
|
tmp2 = "60fps";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
framerate = 0;
|
|
||||||
tmp2 = g_Locale->getText(LOCALE_STREAMINFO_FRAMERATE_UNKNOWN);
|
tmp2 = g_Locale->getText(LOCALE_STREAMINFO_FRAMERATE_UNKNOWN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -985,21 +990,10 @@ bool CInfoViewer::showLivestreamInfo()
|
|||||||
if (!tmp1.empty())
|
if (!tmp1.empty())
|
||||||
livestreamInfo2 += (std::string)", " + tmp1;
|
livestreamInfo2 += (std::string)", " + tmp1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (livestreamInfo1 != _livestreamInfo1 || livestreamInfo2 != _livestreamInfo2) {
|
|
||||||
display_Info(livestreamInfo1.c_str(), livestreamInfo2.c_str(), false);
|
|
||||||
_livestreamInfo1 = livestreamInfo1;
|
|
||||||
_livestreamInfo2 = livestreamInfo2;
|
|
||||||
infoViewerBB->showBBButtons(true /*paintFooter*/);
|
|
||||||
}
|
}
|
||||||
return true;
|
else
|
||||||
}
|
|
||||||
// FIXME: move this block in the block above
|
|
||||||
else if (web_mode && cc->getEpgID() == 0)
|
|
||||||
{
|
{
|
||||||
// try to get meta data
|
// try to get meta data
|
||||||
std::string livestreamInfo1 = "";
|
|
||||||
std::string livestreamInfo2 = "";
|
|
||||||
std::string artist = "";
|
std::string artist = "";
|
||||||
std::string title = "";
|
std::string title = "";
|
||||||
std::vector<std::string> keys, values;
|
std::vector<std::string> keys, values;
|
||||||
@@ -1007,14 +1001,18 @@ bool CInfoViewer::showLivestreamInfo()
|
|||||||
if (playback)
|
if (playback)
|
||||||
playback->GetMetadata(keys, values);
|
playback->GetMetadata(keys, values);
|
||||||
size_t count = keys.size();
|
size_t count = keys.size();
|
||||||
if (count > 0) {
|
if (count > 0)
|
||||||
for (size_t i = 0; i < count; i++) {
|
{
|
||||||
|
for (size_t i = 0; i < count; i++)
|
||||||
|
{
|
||||||
std::string key = trim(keys[i]);
|
std::string key = trim(keys[i]);
|
||||||
if (!strcasecmp("artist", key.c_str())) {
|
if (!strcasecmp("artist", key.c_str()))
|
||||||
|
{
|
||||||
artist = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]);
|
artist = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!strcasecmp("title", key.c_str())) {
|
if (!strcasecmp("title", key.c_str()))
|
||||||
|
{
|
||||||
title = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]);
|
title = isUTF8(values[i]) ? values[i] : convertLatin1UTF8(values[i]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1030,7 +1028,10 @@ bool CInfoViewer::showLivestreamInfo()
|
|||||||
livestreamInfo1 += " - ";
|
livestreamInfo1 += " - ";
|
||||||
livestreamInfo1 += title;
|
livestreamInfo1 += title;
|
||||||
}
|
}
|
||||||
if (livestreamInfo1 != _livestreamInfo1 || livestreamInfo2 != _livestreamInfo2) {
|
}
|
||||||
|
|
||||||
|
if (livestreamInfo1 != _livestreamInfo1 || livestreamInfo2 != _livestreamInfo2)
|
||||||
|
{
|
||||||
display_Info(livestreamInfo1.c_str(), livestreamInfo2.c_str(), false);
|
display_Info(livestreamInfo1.c_str(), livestreamInfo2.c_str(), false);
|
||||||
_livestreamInfo1 = livestreamInfo1;
|
_livestreamInfo1 = livestreamInfo1;
|
||||||
_livestreamInfo2 = livestreamInfo2;
|
_livestreamInfo2 = livestreamInfo2;
|
||||||
@@ -1038,7 +1039,6 @@ bool CInfoViewer::showLivestreamInfo()
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user