mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CLuaInstance: The first call to Lua::PlayFile() block restoreNeutrino
- Running restoreNeutrino when exiting the plugin and function is blocked - Set Lua api version to 1.18
This commit is contained in:
@@ -67,6 +67,14 @@ int CLuaInstance::PlayFile(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CLuaData *W = CheckData(L, 1);
|
||||||
|
if (!W)
|
||||||
|
return 0;
|
||||||
|
if (W->moviePlayerBlocked == false) {
|
||||||
|
CMoviePlayerGui::getInstance().setBlockedFromPlugin(true);
|
||||||
|
W->moviePlayerBlocked = true;
|
||||||
|
}
|
||||||
|
|
||||||
const char *title;
|
const char *title;
|
||||||
const char *info1 = "";
|
const char *info1 = "";
|
||||||
const char *info2 = "";
|
const char *info2 = "";
|
||||||
|
@@ -512,6 +512,11 @@ void CLuaInstance::runScript(const char *fileName, std::vector<std::string> *arg
|
|||||||
DisplayErrorMessage(lua_tostring(lua, -1), "Lua Script Error:");
|
DisplayErrorMessage(lua_tostring(lua, -1), "Lua Script Error:");
|
||||||
if (error_string)
|
if (error_string)
|
||||||
*error_string = std::string(lua_tostring(lua, -1));
|
*error_string = std::string(lua_tostring(lua, -1));
|
||||||
|
/* restoreNeutrino at plugin crash, when blocked from plugin */
|
||||||
|
if (CMoviePlayerGui::getInstance().getBlockedFromPlugin()) {
|
||||||
|
CMoviePlayerGui::getInstance().setBlockedFromPlugin(false);
|
||||||
|
CMoviePlayerGui::getInstance().restoreNeutrino();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -660,6 +665,7 @@ int CLuaInstance::NewWindow(lua_State *L)
|
|||||||
CFBWindow *W = new CFBWindow(x, y, w, h);
|
CFBWindow *W = new CFBWindow(x, y, w, h);
|
||||||
D->fbwin = W;
|
D->fbwin = W;
|
||||||
D->rcinput = g_RCInput;
|
D->rcinput = g_RCInput;
|
||||||
|
D->moviePlayerBlocked = false;
|
||||||
lua_boxpointer(L, D);
|
lua_boxpointer(L, D);
|
||||||
luaL_getmetatable(L, className);
|
luaL_getmetatable(L, className);
|
||||||
lua_setmetatable(L, -2);
|
lua_setmetatable(L, -2);
|
||||||
@@ -1156,6 +1162,16 @@ int CLuaInstance::GCWindow(lua_State *L)
|
|||||||
}
|
}
|
||||||
CNeutrinoFonts::getInstance()->deleteDynFontExtAll();
|
CNeutrinoFonts::getInstance()->deleteDynFontExtAll();
|
||||||
|
|
||||||
|
/* restoreNeutrino at plugin closing, when blocked from plugin */
|
||||||
|
if (w->moviePlayerBlocked &&
|
||||||
|
CMoviePlayerGui::getInstance().getBlockedFromPlugin() &&
|
||||||
|
CMoviePlayerGui::getInstance().Playing()) {
|
||||||
|
// printf(">>>>[%s:%d] (restoreNeutrino()) moviePlayerBlocked: %d\n", __func__, __LINE__, w->moviePlayerBlocked);
|
||||||
|
CMoviePlayerGui::getInstance().setBlockedFromPlugin(false);
|
||||||
|
w->moviePlayerBlocked = false;
|
||||||
|
CMoviePlayerGui::getInstance().restoreNeutrino();
|
||||||
|
}
|
||||||
|
|
||||||
delete w->fbwin;
|
delete w->fbwin;
|
||||||
w->rcinput = NULL;
|
w->rcinput = NULL;
|
||||||
delete w;
|
delete w;
|
||||||
|
@@ -34,7 +34,7 @@ extern "C" {
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define LUA_API_VERSION_MAJOR 1
|
#define LUA_API_VERSION_MAJOR 1
|
||||||
#define LUA_API_VERSION_MINOR 17
|
#define LUA_API_VERSION_MINOR 18
|
||||||
|
|
||||||
typedef std::pair<lua_Integer, Font*> fontmap_pair_t;
|
typedef std::pair<lua_Integer, Font*> fontmap_pair_t;
|
||||||
typedef std::map<lua_Integer, Font*> fontmap_t;
|
typedef std::map<lua_Integer, Font*> fontmap_t;
|
||||||
@@ -51,6 +51,7 @@ struct CLuaData
|
|||||||
CRCInput *rcinput;
|
CRCInput *rcinput;
|
||||||
fontmap_t fontmap;
|
fontmap_t fontmap;
|
||||||
screenmap_t screenmap;
|
screenmap_t screenmap;
|
||||||
|
bool moviePlayerBlocked;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct CLuaMenuItem
|
struct CLuaMenuItem
|
||||||
|
Reference in New Issue
Block a user