diff -r -u -X diff.exclude myth.14030.0722a/mythtv/programs/mythfrontend/playbackbox.cpp myth.14030.0722b/mythtv/programs/mythfrontend/playbackbox.cpp
--- mythtv/programs/mythfrontend/playbackbox.cpp	2007-07-24 00:00:37.000000000 -0500
+++ mythtv/programs/mythfrontend/playbackbox.cpp	2007-07-24 03:31:48.000000000 -0500
@@ -571,7 +571,12 @@
     if (name.lower() == "program_info_del" && context == 1 && type == Delete)
         drawInfoBounds = area;
     if (name.lower() == "video")
+    {
         drawVideoBounds = area;
+        QSize size = drawVideoBounds.size();
+        drawVideoBoundsAspect = ((float)size.width()) / ((float)size.height());
+        previewVideoAspect = drawVideoBoundsAspect;
+    }
     if (name.lower() == "group_info")
         drawGroupBounds = area;        
     if (name.lower() == "usage")
@@ -1003,7 +1008,62 @@
     {
         QPixmap temp = getPixmap(curitem);
         if (temp.width() > 0)
-            p->drawPixmap(drawVideoBounds.x(), drawVideoBounds.y(), temp);
+        {
+            if (temp.size() == drawVideoBounds.size())
+            {
+                p->drawPixmap(drawVideoBounds.x(), drawVideoBounds.y(), temp);
+            }
+            else
+            {
+                QSize size = drawVideoBounds.size();
+                int voffset = 0, hoffset = 0;
+                float vaspect = ((float) temp.width()) / ((float) temp.height());
+
+                if ( drawVideoBoundsAspect > vaspect) {
+                   // The aspect ratio of the preview window is greater than that of the image
+                   // being displayed.  This can happen when trying to display a 4:3 image
+                   // in a 16:9 window.  We need to calculate the width of the image.
+                   size.setWidth( size.height() * vaspect );
+
+                } else if (vaspect > drawVideoBoundsAspect && vaspect > 0.0) {
+                   // The aspect ratio of the preview window is smaller than that of the image
+                   // being displayed.  This can happen when trying to display a 16:9 image
+                   // in a 4:3 window.  We need to calculate the height of the image.
+                   size.setHeight( size.width() / vaspect );
+                }
+
+                size.setHeight(((size.height() + 7) / 8) * 8);
+                size.setWidth( ((size.width()  + 7) / 8) * 8);
+
+                hoffset = (drawVideoBounds.width() - size.width()) / 2;
+                voffset = (drawVideoBounds.height() - size.height()) / 2;
+
+
+                if (hoffset > 0) {
+                    QSize barsize = drawVideoBounds.size();
+                    barsize.setWidth(hoffset);
+                    QPixmap qpm(barsize);
+                    qpm.fill(black);
+                    p->drawPixmap(drawVideoBounds.x(), drawVideoBounds.y(), qpm);
+                    p->drawPixmap(drawVideoBounds.x()+drawVideoBounds.width()-hoffset, drawVideoBounds.y(), qpm);
+                }
+                if (voffset > 0) {
+                    QSize barsize = drawVideoBounds.size();
+                    barsize.setHeight(voffset);
+                    QPixmap qpm(barsize);
+                    qpm.fill(black);
+                    p->drawPixmap(drawVideoBounds.x(), drawVideoBounds.y(), qpm);
+                    p->drawPixmap(drawVideoBounds.x(), drawVideoBounds.y()+drawVideoBounds.height()-(voffset-1), qpm);
+                }
+         
+                // Scale and draw the preview image
+                QImage previewImg = temp.convertToImage();
+                QImage previewImgScaled = previewImg.smoothScale (size.width(), size.height());
+
+                p->drawImage(drawVideoBounds.x() + hoffset, drawVideoBounds.y() + voffset, previewImgScaled);
+
+            }
+        }
     }
 
     /* keep calling killPlayer() to handle nvp cleanup */
@@ -1056,6 +1116,9 @@
         previewVideoState = kStarting;
     }
 
+    if (previewVideoState == kStarting)
+        previewVideoAspect = 0.0;
+
     if ((previewVideoState == kStarting) && 
         (!previewVideoStartTimerOn ||
          (previewVideoStartTimer.elapsed() > 500)))
@@ -1097,13 +1160,55 @@
         !playingSomething)
     {
         QSize size = drawVideoBounds.size();
-        float saspect = ((float)size.width()) / ((float)size.height());
+        int voffset = 0, hoffset = 0;
         float vaspect = previewVideoNVP->GetVideoAspect();
-        size.setHeight((int) ceil(size.height() * (saspect / vaspect)));
+
+        if ( drawVideoBoundsAspect > vaspect) {
+           // The aspect ratio of the preview window is greater than that of the image
+           // being displayed.  This can happen when trying to display a 4:3 image
+           // in a 16:9 window.  We need to calculate the width of the image.
+           size.setWidth( size.height() * vaspect );
+
+        } else if (vaspect > drawVideoBoundsAspect && vaspect > 0.0) {
+           // The aspect ratio of the preview window is smaller than that of the image
+           // being displayed.  This can happen when trying to display a 16:9 image
+           // in a 4:3 window.  We need to calculate the height of the image
+           size.setHeight( size.width() / vaspect );
+        }
+
         size.setHeight(((size.height() + 7) / 8) * 8);
         size.setWidth( ((size.width()  + 7) / 8) * 8);
+
+        hoffset = (drawVideoBounds.width() - size.width()) / 2;
+        voffset = (drawVideoBounds.height() - size.height()) / 2;
+
+        if (hoffset > 0 || voffset > 0) {
+            if (previewVideoAspect != vaspect) {
+                // If the Aspect ratio has changed draw the black bars either above and below the image,
+                // or on either side of the image.
+                previewVideoAspect = vaspect;
+
+                if (hoffset > 0) {
+                    QSize barsize = drawVideoBounds.size();
+                    barsize.setWidth(hoffset);
+                    QPixmap qpm(barsize);
+                    qpm.fill(black);
+                    p->drawPixmap(drawVideoBounds.x(), drawVideoBounds.y(), qpm);
+                    p->drawPixmap(drawVideoBounds.x()+drawVideoBounds.width()-hoffset, drawVideoBounds.y(), qpm);
+                }
+                if (voffset > 0) {
+                    QSize barsize = drawVideoBounds.size();
+                    barsize.setHeight(voffset);
+                    QPixmap qpm(barsize);
+                    qpm.fill(black);
+                    p->drawPixmap(drawVideoBounds.x(), drawVideoBounds.y(), qpm);
+                    p->drawPixmap(drawVideoBounds.x(), drawVideoBounds.y()+drawVideoBounds.height()-voffset, qpm);
+                }
+            }
+        }
+
         const QImage &img = previewVideoNVP->GetARGBFrame(size);
-        p->drawImage(drawVideoBounds.x(), drawVideoBounds.y(), img);
+        p->drawImage(drawVideoBounds.x() + hoffset, drawVideoBounds.y() + voffset, img);
     }
 
     /* have we timed out waiting for nvp to start? */
Only in myth.14030.0722a/mythtv/programs/mythfrontend: playbackbox.cpp~
diff -r -u -X diff.exclude myth.14030.0722a/mythtv/programs/mythfrontend/playbackbox.h myth.14030.0722b/mythtv/programs/mythfrontend/playbackbox.h
--- mythtv/programs/mythfrontend/playbackbox.h	2007-07-12 06:30:04.000000000 -0500
+++ mythtv/programs/mythfrontend/playbackbox.h	2007-07-24 03:27:38.000000000 -0500
@@ -365,6 +365,10 @@
     QRect               drawVideoBounds;
     QRect               drawCurGroupBounds;
 
+    // Aspect ratio cache for previews
+    float               drawVideoBoundsAspect;
+    float               previewVideoAspect;
+
     // Popup support //////////////////////////////////////////////////////////
     // General popup support
     MythPopupBox       *popup;
