[mythtv] XvMC surface check [segfaulting BUG] [PATCH]

Daniel Thor Kristjansson danielk at cat.nyu.edu
Tue Jul 6 12:33:34 EDT 2004

This is a simple patch that checks if you successfully created an
XvMC surface. When we create an XvMC surface we currently don't check if
we were successful before using it. This isn't a problem most of the
time because we don't create the surface unless the graphics adapter
supports XvMC. However it may only support XvMC on one screen and you
are trying to create the surface on a different screen (with Xinerama
the virtual screen may support XvMC while the actual screen does not).

This patch prevents the segfault by simply testing for an invalid xv
port before trying to use it.

-- Daniel
-------------- next part --------------
Index: libs/libmythtv/videoout_xvmc.cpp
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/videoout_xvmc.cpp,v
retrieving revision 1.29
diff -u -r1.29 videoout_xvmc.cpp
--- libs/libmythtv/videoout_xvmc.cpp	20 May 2004 07:09:02 -0000	1.29
+++ libs/libmythtv/videoout_xvmc.cpp	6 Jul 2004 16:19:35 -0000
@@ -312,6 +312,11 @@
+    if (xv_port<=0)
+    {
+        cerr << "Invalid xv port " << xv_port << endl;
+	return false;
+    }
 #ifndef QWS
     GetMythTVGeometry(data->XJ_disp, XJ_screen_num,

More information about the mythtv-dev mailing list