Index: libs/libmythtv/util-opengl.cpp
===================================================================
--- libs/libmythtv/util-opengl.cpp	(revision 13753)
+++ libs/libmythtv/util-opengl.cpp	(working copy)
@@ -67,7 +67,21 @@
 {
     int ret, errbase, eventbase, gl_major, gl_minor;
 
+    // this crashes my Unichrome-based system if it is run more than once.
+    static bool has_run = false;
+    static int static_major = 0;
+    static int static_minor = 0;
+    static int static_ret = false;
+
+    if( has_run )
+    {
+        major = static_major;
+        minor = static_minor;
+        return static_ret;
+    }
+
     major = minor = 0;
+    has_run = true;
 
     X11S(ret = glXQueryExtension(XJ_disp, &errbase, &eventbase));
     if (!ret)
@@ -86,8 +100,9 @@
     if (!ret)
         return false;
 
-    major = gl_major;
-    minor = gl_minor;
+    static_major = major = gl_major;
+    static_minor = minor = gl_minor;
+    static_ret = true;
 
     return true;
 }
Index: libs/libmythtv/videoout_xv.cpp
===================================================================
--- libs/libmythtv/videoout_xv.cpp	(revision 13753)
+++ libs/libmythtv/videoout_xv.cpp	(working copy)
@@ -1756,8 +1756,9 @@
     if (!xvmc_ctx)
         return false;
 
-    bool createBlocks = !(XVMC_VLD == (xvmc_surf_info.mc_type & XVMC_VLD));
-    xvmc_surfs = CreateXvMCSurfaces(xvmc_buf_attr->GetMaxSurf(), createBlocks);
+    bool surface_has_vld = (XVMC_VLD == (xvmc_surf_info.mc_type & XVMC_VLD));
+    xvmc_surfs = CreateXvMCSurfaces(xvmc_buf_attr->GetMaxSurf(), 
+                                    surface_has_vld);
     if (xvmc_surfs.size() < xvmc_buf_attr->GetMinSurf())
     {
         VERBOSE(VB_IMPORTANT, LOC_ERR + "Unable to create XvMC Surfaces");
@@ -1787,7 +1788,6 @@
     }
     xvmc_osd_lock.unlock();
 
-
     X11S(XSync(XJ_disp, False));
 
     return true;
@@ -1796,10 +1796,10 @@
 #endif // USING_XVMC
 }
 
-vector<void*> VideoOutputXv::CreateXvMCSurfaces(uint num, bool create_xvmc_blocks)
+vector<void*> VideoOutputXv::CreateXvMCSurfaces(uint num, bool surface_has_vld)
 {
     (void)num;
-    (void)create_xvmc_blocks;
+    (void)surface_has_vld;
 
     vector<void*> surfaces;
 #ifdef USING_XVMC
@@ -1808,6 +1808,10 @@
                             ((video_dim.height() + 15) / 16));
     uint num_data_blocks = num_mv_blocks * blocks_per_macroblock;
 
+    // need the equivalent of 5 extra surfaces for VLD decoding
+    if( surface_has_vld )
+        num += 5;
+
     // create needed XvMC stuff
     bool ok = true;
     for (uint i = 0; i < num; i++)
@@ -1820,7 +1824,7 @@
         int ret = XvMCCreateSurface(XJ_disp, xvmc_ctx, &(surf->surface));
         ok &= (Success == ret);
 
-        if (create_xvmc_blocks && ok)
+        if (ok && !surface_has_vld)
         {
             ret = XvMCCreateBlocks(XJ_disp, xvmc_ctx, num_data_blocks,
                                    &(surf->blocks));
@@ -1831,7 +1835,7 @@
             }
         }
 
-        if (create_xvmc_blocks && ok)
+        if (ok && !surface_has_vld)
         {
             ret = XvMCCreateMacroBlocks(XJ_disp, xvmc_ctx, num_mv_blocks,
                                         &(surf->macro_blocks));
@@ -1852,6 +1856,24 @@
         }
         surfaces.push_back(surf);
     }
+
+    // for VLD decoding: the last 5 surfaces were allocated just to make
+    // sure we had enough space.  now, deallocate/destroy them.
+
+    if( surface_has_vld )
+    {
+        VERBOSE(VB_PLAYBACK, 
+                LOC + QString("VLD - Allocated %1 surfaces, now destroying 5 of them.").arg(surfaces.size()));
+
+        for( uint i = 0; i < 5; i++ )
+        {
+            xvmc_vo_surf_t *surf = (xvmc_vo_surf_t*)surfaces.back();
+            surfaces.pop_back();
+            XvMCDestroySurface(XJ_disp, &(surf->surface));
+            delete surf;
+        }
+    }
+
 #endif // USING_XVMC
     return surfaces;
 }
@@ -4192,11 +4214,11 @@
             break;
 
         case kCodec_MPEG1_VLD:
-            vld = true;
+            mc = vld = true;
             ret = CODEC_ID_MPEG2VIDEO_XVMC_VLD;
             break;
         case kCodec_MPEG2_VLD:
-            vld = true;
+            mc = vld = true;
             ret = CODEC_ID_MPEG2VIDEO_XVMC_VLD;
             break;
         case kCodec_H263_VLD:
