Index: libs/libmythtv/videoout_xv.h
===================================================================
--- libs/libmythtv/videoout_xv.h	(revision 14148)
+++ libs/libmythtv/videoout_xv.h	(working copy)
@@ -170,7 +170,7 @@
 
     bool CreateXvMCBuffers(void);
     bool CreateBuffers(VOSType subtype);
-    vector<void*> CreateXvMCSurfaces(uint num, bool create_xvmc_blocks);
+    vector<void*> CreateXvMCSurfaces(uint num, bool surface_has_vld);
     vector<unsigned char*> CreateShmImages(uint num, bool use_xv);
     void CreatePauseFrame(VOSType subtype);
     void CopyFrame(VideoFrame *to, const VideoFrame *from);
Index: libs/libmythtv/util-opengl.cpp
===================================================================
--- libs/libmythtv/util-opengl.cpp	(revision 14148)
+++ 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 14148)
+++ libs/libmythtv/videoout_xv.cpp	(working copy)
@@ -1785,8 +1785,10 @@
     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");
@@ -1825,10 +1827,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
@@ -1837,6 +1839,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++)
@@ -1849,7 +1855,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));
@@ -1860,7 +1866,7 @@
             }
         }
 
-        if (create_xvmc_blocks && ok)
+        if (ok && !surface_has_vld)
         {
             ret = XvMCCreateMacroBlocks(XJ_disp, xvmc_ctx, num_mv_blocks,
                                         &(surf->macro_blocks));
@@ -1881,6 +1887,22 @@
         }
         surfaces.push_back(surf);
     }
+
+    // for VLD decoding: the last 5 surface 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;
 }
@@ -4144,7 +4166,6 @@
     SetFromEnv(vld, idct, mc, xv, shm, opengl);
     SetFromHW(XJ_disp, mc, xv, shm, xvmc_opengl, opengl);
 
-    vld  &= mc;
     idct &= mc;
 
     QStringList list;
