Index: libs/libmythtv/NuppelVideoRecorder.cpp
===================================================================
--- libs/libmythtv/NuppelVideoRecorder.cpp	(revision 10844)
+++ libs/libmythtv/NuppelVideoRecorder.cpp	(working copy)
@@ -2752,11 +2752,10 @@
             case ACTION_VIDEO:
             {
                 VideoFrame frame;
-                frame.codec = FMT_YV12;
-                frame.width = w;
-                frame.height = h;
-                frame.buf = videobuffer[act_video_encode]->buffer;
-                frame.size = videobuffer[act_video_encode]->bufferlen;
+                init(&frame,
+                     FMT_YV12, videobuffer[act_video_encode]->buffer,
+                     w, h, 12, videobuffer[act_video_encode]->bufferlen);
+
                 frame.frameNumber = videobuffer[act_video_encode]->sample;
                 frame.timecode = videobuffer[act_video_encode]->timecode;
                 frame.forcekey = videobuffer[act_video_encode]->forcekey;  
Index: libs/libmythtv/frame.h
===================================================================
--- libs/libmythtv/frame.h	(revision 10799)
+++ libs/libmythtv/frame.h	(working copy)
@@ -1,6 +1,12 @@
 #ifndef _FRAME_H
 #define _FRAME_H 
 
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 typedef enum FrameType_
 {
     FMT_NONE = -1,
@@ -20,8 +26,8 @@
     VideoFrameType codec;
     unsigned char *buf;
 
+    int width;
     int height;
-    int width;
     int bpp;
     int size;
 
@@ -42,5 +48,87 @@
     int offsets[3]; // Y, U, & V offsets
 } VideoFrame;
 
+#ifdef __cplusplus
+}
 #endif
 
+#ifdef __cplusplus
+static inline void init(
+    VideoFrame *vf,
+    VideoFrameType _codec, unsigned char *_buf,
+    int _width, int _height, int _bpp, int _size,
+    const int *p = 0, const int *o = 0) __attribute__ ((unused));
+
+static inline void init(
+    VideoFrame *vf,
+    VideoFrameType _codec, unsigned char *_buf,
+    int _width, int _height, int _bpp, int _size,
+    const int *p, const int *o)
+{
+    vf->codec  = _codec;
+    vf->buf    = _buf;
+    vf->width  = _width;
+    vf->height = _height;
+
+    vf->bpp          = _bpp;
+    vf->size         = _size;
+    vf->frameNumber  = 0;
+    vf->timecode     = 0;
+
+    vf->qscale_table = 0;
+    vf->qstride      = 0;
+
+    vf->interlaced_frame = 1;
+    vf->top_field_first  = 1;
+    vf->repeat_pict      = 0;
+    vf->forcekey         = 0;
+
+    bzero(vf->priv, 4 * sizeof(unsigned char *));
+
+    if (p)
+    {
+        memcpy(vf->pitches, p, 3 * sizeof(int));
+    }
+    else
+    {
+        if (FMT_YV12 == _codec || FMT_YUV422P == _codec)
+        {
+            vf->pitches[0] = _width;
+            vf->pitches[1] = vf->pitches[2] = _width >> 1;
+        }
+        else
+        {
+            vf->pitches[0] = (_width * _bpp) >> 3;
+            vf->pitches[1] = vf->pitches[2] = 0;
+        }
+    }
+        
+    if (o)
+    {
+        memcpy(vf->offsets, o, 3 * sizeof(int));
+    }
+    else
+    {
+        if (FMT_YV12 == _codec)
+        {
+            vf->offsets[0] = 0;
+            vf->offsets[1] = _width * _height;
+            vf->offsets[2] = vf->offsets[1] + (vf->offsets[1] >> 2);
+        }
+        else if (FMT_YUV422P == _codec)
+        {
+            vf->offsets[0] = 0;
+            vf->offsets[1] = _width * _height;
+            vf->offsets[2] = vf->offsets[1] + (vf->offsets[1] >> 1);
+        }
+        else
+        {
+            vf->offsets[0] = vf->offsets[1] = vf->offsets[2] = 0;
+        }
+    }
+}
+
+#endif /* __cplusplus */
+
+#endif
+
Index: libs/libmythtv/videoout_ivtv.cpp
===================================================================
--- libs/libmythtv/videoout_ivtv.cpp	(revision 10799)
+++ libs/libmythtv/videoout_ivtv.cpp	(working copy)
@@ -443,10 +443,8 @@
         return;
 
     VideoFrame tmpframe;
-    tmpframe.codec = FMT_ARGB32;
-    tmpframe.buf = (unsigned char *)osdbuf_aligned;
-    tmpframe.width = stride;
-    tmpframe.height = video_dim.height();
+    init(&tmpframe, FMT_ARGB32, (unsigned char *)osdbuf_aligned,
+         stride, video_dim.height(), 32, 4 * stride * video_dim.height());
 
     OSDSurface *surface = NULL;
     if (osd)
Index: libs/libmythtv/videobuffers.cpp
===================================================================
--- libs/libmythtv/videobuffers.cpp	(revision 10799)
+++ libs/libmythtv/videobuffers.cpp	(working copy)
@@ -1135,16 +1135,11 @@
 
     for (uint i = 0; i < allocSize(); i++)
     {
-        buffers[i].width  = yuvinfo[i].width;
-        buffers[i].height = yuvinfo[i].height;
-        memcpy(buffers[i].pitches, yuvinfo[i].pitches, 3 * sizeof(int));
-        memcpy(buffers[i].offsets, yuvinfo[i].offsets, 3 * sizeof(int));
-        buffers[i].bpp = 12;
-        buffers[i].size = max(buf_size, yuvinfo[i].size);
-        buffers[i].codec = FMT_YV12;
-        buffers[i].qscale_table = NULL;
-        buffers[i].qstride = 0;
-        buffers[i].buf = bufs[i];
+        init(&buffers[i],
+             FMT_YV12, bufs[i], yuvinfo[i].width, yuvinfo[i].height,
+             12, max(buf_size, yuvinfo[i].size),
+             (const int*) yuvinfo[i].pitches, (const int*) yuvinfo[i].offsets);
+
         ok &= (bufs[i] != NULL);
     }
 
@@ -1187,26 +1182,25 @@
         xvmc_render_state_t *render = new xvmc_render_state_t;
         allocated_structs.push_back((unsigned char*)render);
         memset(render, 0, sizeof(xvmc_render_state_t));
-        buffers[i].buf          = (unsigned char*) render;
 
         // constants
         render->magic           = MP_XVMC_RENDER_MAGIC;
         render->state           = 0;
-        buffers[i].bpp          = -1;
-        buffers[i].codec        = FMT_XVMC_IDCT_MPEG2;
-        buffers[i].size         = sizeof(XvMCSurface);
 
         // from videoout_xv
         render->disp            = disp;
         render->ctx             = &xvmc_ctx;
 
-        // from width, height, and xvmv block and surface arrays
+        // from xvmv block and surface arrays
         render->p_surface       = &surf->surface;
-        buffers[i].height       = height;
-        buffers[i].width        = width;
 
         render->total_number_of_data_blocks = surf->blocks.num_blocks;
         render->total_number_of_mv_blocks   = surf->macro_blocks.num_blocks;
+
+        init(&buffers[i],
+             FMT_XVMC_IDCT_MPEG2, (unsigned char*) render,
+             width, height, -1, sizeof(XvMCSurface));
+
         buffers[i].priv[0]      = ffmpeg_vld_hack;
         buffers[i].priv[1]      = ffmpeg_vld_hack;
 
