[mythtv] [PATCH] amd64 (-march=k8) frontend crash with ivtv

tommy myth-dev at tommywatson.com
Tue Dec 28 06:37:59 UTC 2004


The pointer manipulation in the two lines of code are incorrect for k8 
processors, they were causing the frontend to segfault on playback.
This hasn't been tested on a 32 bit processor, so if someone could make 
sure it compiles without warnings and works that would be great.

Cheers,
   Tom.

-------------- next part --------------
Index: libs/libmythtv/videoout_ivtv.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/videoout_ivtv.cpp,v
retrieving revision 1.36
diff -u -r1.36 videoout_ivtv.cpp
--- libs/libmythtv/videoout_ivtv.cpp	12 Nov 2004 01:17:22 -0000	1.36
+++ libs/libmythtv/videoout_ivtv.cpp	28 Dec 2004 06:30:09 -0000
@@ -202,8 +202,8 @@
         long pagesize = sysconf(_SC_PAGE_SIZE);
         long pagemask = ~(pagesize-1);
         osdbuffer = new char[osdbufsize + pagesize];
-        osdbuf_aligned = (char *)((int)osdbuffer + (pagesize - 1));
-        osdbuf_aligned = (char *)((int)osdbuf_aligned & pagemask);
+        osdbuf_aligned = osdbuffer + (pagesize - 1);
+        osdbuf_aligned = (char *)((unsigned long)osdbuf_aligned & pagemask);
 
         memset(osdbuf_aligned, 0x00, osdbufsize);
 


More information about the mythtv-dev mailing list