Lockup when playing a video (ttf sub) that hang
#1
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:Confusedetbrightnesscontrastgammapercent(g_settings.m_ibrightness,g_settings.m_icontrast,g_settin
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;
}
Reply

Logout Mark Read Team Forum Stats Members Help
Lockup when playing a video (ttf sub) that hang0