[mythtv-commits] Ticket #1899: frontend segfault (dvb teletext subtitle related?)

MythTV mythtv at cvs.mythtv.org
Wed Jun 21 04:03:33 UTC 2006


#1899: frontend segfault (dvb teletext subtitle related?)
-------------------------------------------------+--------------------------
 Reporter:  torbjorn.jansson at mbox200.swipnet.se  |        Owner:  danielk
     Type:  defect                               |       Status:  new    
 Priority:  minor                                |    Milestone:  0.20   
Component:  mythtv                               |      Version:  head   
 Severity:  medium                               |   Resolution:         
-------------------------------------------------+--------------------------
Comment (by pholmes at india.com):

 The problem is in the osdtypeteletext.cpp file. This code makes use of the
 'm_surface' variable supplied from the OSD class. The problem is that it
 will access this without setting the OSD locks so when they are both using
 it the system crashes.

 I implemented the following changes to fix this (sorry not sure how to use
 the diff tool yet).

 file: osdtypeteletext.h.

 Added     #include "osd.h"
 In class OSDTypeTeletext
 Modified constructor from
     OSDTypeTeletext(const QString &name, TTFFont *font, QRect displayrect,
 float wmult, float hmult);
 to
     OSDTypeTeletext(const QString &name, TTFFont *font, QRect displayrect,
 float wmult, float hmult, OSD *osd);

 Added private var
           OSD      *parent_osd


 file: osd.h

 In class OSD
 Added to the public functions
           void SurfaceLock(void) {osdlock.lock();};
           void SurfaceUnLock(void) {osdlock.unlock();};

 file: osd.cpp

 in function OSD::InitTeletext modified
     OSDTypeTeletext *ttpage = new OSDTypeTeletext(name, font, area, wmult,
 hmult);
 to
     OSDTypeTeletext *ttpage = new OSDTypeTeletext(name, font, area, wmult,
 hmult, this);

 file: osdtypeteletext.cpp

 Changed:
     OSDTypeTeletext::OSDTypeTeletext(const QString &name, TTFFont *font,
 QRect displayrect, float wmult, float hmult)
 to
     OSDTypeTeletext::OSDTypeTeletext(const QString &name, TTFFont *font,
 QRect displayrect, float wmult, float hmult, OSD *osd)

 also added
     parent_osd(osd)  to the initialized variables list

 in function void OSDTypeTeletext::PageUpdated(int page, int subpage)
 changed
     if (m_surface != NULL)
     {
         m_surface->SetChanged(true);
         m_surface->ClearUsed();
         DrawPage();
     }
 to
     if (m_surface != NULL)
     {
         parent_osd->Surface_Lock();
         m_surface->SetChanged(true);
         m_surface->ClearUsed();
         DrawPage();
         parent_osd->Surface_UnLock();
     }


 in function void OSDTypeTeletext::HeaderUpdated(unsigned char *page, int
 lang)
 changed
     if (m_surface != NULL)
         DrawHeader(page, lang);
 to
     if (m_surface != NULL)
     {
         parent_osd->Surface_Lock();
         DrawHeader(page, lang);
         parent_osd->Surface_UnLock();
     }



 After these changes the wife has not reported any more crashes while
 watching her shows with the subtitles (teletext page 801) on.

-- 
Ticket URL: <http://cvs.mythtv.org/trac/ticket/1899>
MythTV <http://www.mythtv.org/>
MythTV


More information about the mythtv-commits mailing list