![]() |
Lockup when playing a video (ttf sub) that hang - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +--- Thread: Lockup when playing a video (ttf sub) that hang (/showthread.php?tid=7051) |
- simon1219 - 2004-11-07 when playing a avi with ttf subtitle enabled and if it hangs (maybe due video error), the xbmc lockup. it is unable to stop by pressing button (b) which may sometime work only once. well it is me again, simon1219. the problem can be solved by making changes to guiwindowfullscreen.cpp. as the again due to the multiple creating of the cguifontttf objects. here is the bug fix. in guiwindowfullscreen.cpp case gui_msg_window_init: { m_blastrender=false; m_bosdvisible=false; cutil: ![]() gs.m_igamma,true); cguiwindow::onmessage(message); g_graphicscontext.lock(); g_graphicscontext.setfullscreenvideo( true ); g_graphicscontext.unlock(); if (g_application.m_pplayer) g_application.m_pplayer->update(); hideosd(); m_icurrentbookmark=0; m_bshowcodecinfo = false; m_bshowviewmodeinfo = false; // set the correct view mode setviewmode(g_stsettings.m_iviewmode); if (cutil::isusingttfsubtitles()) { csinglelock lock(m_fontlock); /* simon1219 if (m_subtitlefont) { delete m_subtitlefont; m_subtitlefont = null; } */ // simon1219. allocate the resource only if it does not exist. // by deallocating and allocating again may cause lockup in a multi-threading environment // as each deallocating and allocating processes (involve other resources) are not in sync. // of course, one way is to sleep for a short duration between the operations // but this is a better way. if (m_subtitlefont == null) { m_subtitlefont = new cguifontttf(""); cstdstring fontpath = "q:\\media\\fonts\\"; fontpath += g_stsettings.m_szsubtitlefont; if (!m_subtitlefont->load(fontpath, g_stsettings.m_isubtitleheight, g_stsettings.m_isubtitlettfstyle)) { delete m_subtitlefont; m_subtitlefont = null; } } // simon1219 } else { //m_subtitlefont = null; // simon1219. it is safer to deallocate the resource first if (m_subtitlefont) { delete m_subtitlefont; } m_subtitlefont = null; // simon1219 } return true; } |