[mythtv] [patch] Backtrace for SEGV while editing recording

Stuart Auchterlonie stuarta at squashedfrog.net
Fri Jun 3 20:21:49 UTC 2005


On Thu, Apr 28, 2005 at 09:24:51PM +0100, Mark Seagrief wrote:
> Hi,
> 
> I've been seeing this same problem for a while now.  The backtrace from GDB
> looks identical to Neale's.  I sprinkled a lot of printf statements into the
> code and the problem appears to be occurring with the m_displaypos.y being
> wrong (as above), the value of m_displaypos.y only goes incorrect (that I've
> observed), under the following conditions:
> 
> * Editing a clip that has both 16:9 and 4:3 content
> * Already have edit markers visible on the screen
> * Navigate from a 16:9 to 4:3 section of the video clip or from a 16:9 to a
> 4:3 section
> 
> Navigating between 16:9 and 4:3 sections without any edit markers in place
> is fine and doesn't cause a crash.
> 

I've been having a look into this and believe I've found the problem.

Valgrind pointed me in the right direction, namely that in

void OSDTypeImage::Reinit(float wmult, float hmult)
{
    int x = (int)(m_displaypos.x() * wmult / m_wmult);
    int y = (int)(m_displaypos.y() * hmult / m_hmult);
....  
(osdtypes.cpp)


Both m_wmult & m_hmult were being used without being initialized.

I've attached a patch to fix the problem.

Could everyone give it a go and see if it works for them....


Thanks,
Stuart

-------------- next part --------------
Index: libs/libmythtv/osdtypes.cpp
===================================================================
--- libs/libmythtv/osdtypes.cpp	(revision 36)
+++ libs/libmythtv/osdtypes.cpp	(working copy)
@@ -195,7 +195,7 @@
         }
         else if (OSDTypeImage *item = dynamic_cast<OSDTypeImage*>(type))
         {
-            item->Reinit(wmult, hmult);
+            item->Reinit(wchange, hchange, wmult, hmult);
         }
         else if (OSDTypeBox *item = dynamic_cast<OSDTypeBox*>(type))
         {
@@ -796,10 +796,10 @@
     m_name = name;
 }
 
-void OSDTypeImage::Reinit(float wmult, float hmult)
+void OSDTypeImage::Reinit(float wchange, float hchange, float wmult, float hmult)
 {
-    int x = (int)(m_displaypos.x() * wmult / m_wmult);
-    int y = (int)(m_displaypos.y() * hmult / m_hmult);
+    int x = (int)(m_displaypos.x() * wchange);
+    int y = (int)(m_displaypos.y() * hchange);
 
     m_displaypos.setX(x);
     m_displaypos.setY(y);
@@ -1080,7 +1080,7 @@
 
     m_displayrect = QRect(x, y, width, height);
 
-    OSDTypeImage::Reinit(wmult, hmult);
+    OSDTypeImage::Reinit(wchange, hchange, wmult, hmult);
 }
 
 void OSDTypePosSlider::SetPosition(int pos)
@@ -1129,7 +1129,7 @@
 
     m_displayrect = QRect(x, y, width, height);
 
-    OSDTypeImage::Reinit(wmult, hmult);
+    OSDTypeImage::Reinit(wchange, hchange, wmult, hmult);
 }
 
 void OSDTypeFillSlider::SetPosition(int pos)
@@ -1654,7 +1654,7 @@
 void OSDTypePositionImage::Reinit(float wchange, float hchange, float wmult, 
                                   float hmult)
 {
-    OSDTypeImage::Reinit(wmult, hmult);
+    OSDTypeImage::Reinit(wchange, hchange, wmult, hmult);
 
     for (int i = 0; i < m_numpositions; i++)
     {
Index: libs/libmythtv/osdtypes.h
===================================================================
--- libs/libmythtv/osdtypes.h	(revision 36)
+++ libs/libmythtv/osdtypes.h	(working copy)
@@ -226,7 +226,7 @@
     virtual ~OSDTypeImage();
 
     void SetName(const QString &name);
-    void Reinit(float wmult, float hmult);
+    void Reinit(float wchange, float hchange, float wmult, float hmult);
 
     void LoadImage(const QString &filename, float wmult, float hmult, 
                    int scalew = -1, int scaleh = -1);


More information about the mythtv-dev mailing list