diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index f33437e4d..f527b88e2 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -67,6 +67,14 @@ int CLuaInstance::PlayFile(lua_State *L) 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 *info1 = ""; const char *info2 = ""; diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 9e4efc89e..07156505d 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -512,6 +512,11 @@ void CLuaInstance::runScript(const char *fileName, std::vector *arg DisplayErrorMessage(lua_tostring(lua, -1), "Lua Script Error:"); if (error_string) *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); D->fbwin = W; D->rcinput = g_RCInput; + D->moviePlayerBlocked = false; lua_boxpointer(L, D); luaL_getmetatable(L, className); lua_setmetatable(L, -2); @@ -1156,6 +1162,16 @@ int CLuaInstance::GCWindow(lua_State *L) } 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; w->rcinput = NULL; delete w; diff --git a/src/gui/lua/luainstance.h b/src/gui/lua/luainstance.h index 45135ebd4..936580207 100644 --- a/src/gui/lua/luainstance.h +++ b/src/gui/lua/luainstance.h @@ -34,7 +34,7 @@ extern "C" { #include #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 17 +#define LUA_API_VERSION_MINOR 18 typedef std::pair fontmap_pair_t; typedef std::map fontmap_t; @@ -51,6 +51,7 @@ struct CLuaData CRCInput *rcinput; fontmap_t fontmap; screenmap_t screenmap; + bool moviePlayerBlocked; }; struct CLuaMenuItem