mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 10:21:10 +02:00
- movieplayer: fix search for livestream script in webradio mode
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -290,22 +290,22 @@ void CMoviePlayerGui::cutNeutrino()
|
|||||||
g_Zapit->setStandby(true);
|
g_Zapit->setStandby(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int new_mode = NeutrinoModes::mode_unknown;
|
m_ThisMode = NeutrinoModes::mode_unknown;
|
||||||
m_LastMode = CNeutrinoApp::getInstance()->getMode();
|
m_LastMode = CNeutrinoApp::getInstance()->getMode();
|
||||||
printf("%s: old mode %d\n", __func__, m_LastMode);fflush(stdout);
|
printf("%s: last mode %d\n", __func__, m_LastMode);fflush(stdout);
|
||||||
if (isWebChannel)
|
if (isWebChannel)
|
||||||
{
|
{
|
||||||
bool isRadioMode = (m_LastMode == NeutrinoModes::mode_radio || m_LastMode == NeutrinoModes::mode_webradio);
|
bool isRadioMode = (m_LastMode == NeutrinoModes::mode_radio || m_LastMode == NeutrinoModes::mode_webradio);
|
||||||
new_mode = (isRadioMode) ? NeutrinoModes::mode_webradio : NeutrinoModes::mode_webtv;
|
m_ThisMode = (isRadioMode) ? NeutrinoModes::mode_webradio : NeutrinoModes::mode_webtv;
|
||||||
m_LastMode |= NeutrinoModes::norezap;
|
m_LastMode |= NeutrinoModes::norezap;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
new_mode = NeutrinoModes::mode_ts;
|
m_ThisMode = NeutrinoModes::mode_ts;
|
||||||
}
|
}
|
||||||
printf("%s: new mode %d\n", __func__, new_mode);fflush(stdout);
|
printf("%s: this mode %d\n", __func__, m_ThisMode);fflush(stdout);
|
||||||
printf("%s: save mode %x\n", __func__, m_LastMode);fflush(stdout);
|
printf("%s: save mode %x\n", __func__, m_LastMode);fflush(stdout);
|
||||||
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::norezap | new_mode);
|
CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::CHANGEMODE, NeutrinoModes::norezap | m_ThisMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMoviePlayerGui::restoreNeutrino()
|
void CMoviePlayerGui::restoreNeutrino()
|
||||||
@@ -1114,16 +1114,19 @@ bool CMoviePlayerGui::getLiveUrl(const std::string &url, const std::string &scri
|
|||||||
|
|
||||||
if (_script.find("/") == std::string::npos)
|
if (_script.find("/") == std::string::npos)
|
||||||
{
|
{
|
||||||
|
bool webradio = (m_ThisMode == NeutrinoModes::mode_webradio);
|
||||||
|
|
||||||
std::string _s = g_settings.livestreamScriptPath + "/" + _script;
|
std::string _s = g_settings.livestreamScriptPath + "/" + _script;
|
||||||
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
|
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
|
||||||
|
// try livestreamScripts from webradio/webtv autoload directories
|
||||||
if (!file_exists(_s.c_str()))
|
if (!file_exists(_s.c_str()))
|
||||||
{
|
{
|
||||||
_s = std::string(WEBTVDIR_VAR) + "/" + _script;
|
_s = std::string(webradio ? WEBRADIODIR_VAR : WEBTVDIR_VAR) + "/" + _script;
|
||||||
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
|
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
|
||||||
}
|
}
|
||||||
if (!file_exists(_s.c_str()))
|
if (!file_exists(_s.c_str()))
|
||||||
{
|
{
|
||||||
_s = std::string(WEBTVDIR) + "/" + _script;
|
_s = std::string(webradio ? WEBRADIODIR : WEBTVDIR) + "/" + _script;
|
||||||
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
|
printf("[%s:%s:%d] script: %s\n", __file__, __func__, __LINE__, _s.c_str());
|
||||||
}
|
}
|
||||||
_script = _s;
|
_script = _s;
|
||||||
|
@@ -104,6 +104,7 @@ class CMoviePlayerGui : public CMenuTarget
|
|||||||
|
|
||||||
CFrameBuffer * frameBuffer;
|
CFrameBuffer * frameBuffer;
|
||||||
int m_LastMode;
|
int m_LastMode;
|
||||||
|
int m_ThisMode;
|
||||||
|
|
||||||
std::string file_name;
|
std::string file_name;
|
||||||
std::string pretty_name;
|
std::string pretty_name;
|
||||||
|
Reference in New Issue
Block a user