From f6336fbb129d41bcd9e4b6c68e8dc134ff7e1d3b Mon Sep 17 00:00:00 2001
From: Gavin Hurlbut <gjhurlbu@gmail.com>
Date: Tue, 14 Sep 2010 21:45:30 -0700
Subject: [PATCH] Fix green bar in 1080i previews


diff --git a/mythtv/libs/libmythtv/previewgenerator.cpp b/mythtv/libs/libmythtv/previewgenerator.cpp
index e08c606..0945090 100644
--- a/mythtv/libs/libmythtv/previewgenerator.cpp
+++ b/mythtv/libs/libmythtv/previewgenerator.cpp
@@ -531,8 +531,17 @@ bool PreviewGenerator::SavePreview(QString filename,
     if (!data || !width || !height)
         return false;
 
-    const QImage img((unsigned char*) data,
-                     width, height, QImage::Format_RGB32);
+    QImage img((unsigned char*) data,
+               width, height, QImage::Format_RGB32);
+
+    if( width == 1920 && height == 1088 )
+    {
+        // Remove the extra 8 pixels at the bottom of 1080i recordings that
+        // decode to 1088 rows as these are bogus pixels and make the previews
+        // look a bit wrong.  The worst offender seems to be H.264 captures
+        // from HDPVR.
+        img = img.copy(0, 0, 1920, 1080);
+    }
 
     float ppw = max(desired_width, 0);
     float pph = max(desired_height, 0);
-- 
1.7.0.4

