[mythtv] [PATCH] Potential display aspect ratio patch for non-4:3 and non-16:9 displays

Chris Pinkham cpinkham at bc2va.org
Mon Feb 2 01:02:40 EST 2004


Attached is a small patch to try to enhance the code that does the
letterboxing for displays when the video is 4:3 and the display is not.
The patch is to videooutbase.cpp in the libs/libmythtv/ directory.

I have a 1280x800 resolution laptop and noticed that the code was assuming
my display is 16:9 since it's not 4:3.  This causes the 4:3 aspect video to
have black bars added that are too large so the video is displayed at almost
a 4:4 ratio instead of the desired 4:3 ratio.  Instead of assuming the
display is 16:9 if it's not 4:3, the attached code will calculate the
desired video width based upon the video ratio and the display height.

I'd like to know if this breaks display of 4:3 video for anyone who has a 16:9
screen.  I think the new calculation attached would work for any aspect ratio.
-- 

Chris

-------------- next part --------------
Index: videooutbase.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmythtv/videooutbase.cpp,v
retrieving revision 1.40
diff -u -r1.40 videooutbase.cpp
--- videooutbase.cpp	28 Jan 2004 20:23:17 -0000	1.40
+++ videooutbase.cpp	2 Feb 2004 05:54:43 -0000
@@ -389,8 +389,10 @@
         {
             // Display is 16:9 - pillarbox it
             // image in center, 3/4 of the overall width
-            dispxoff += (dispwoff/8);
-            dispwoff = dispwoff*3/4;
+//            dispxoff += (dispwoff/8);
+//            dispwoff = dispwoff*3/4;
+              dispxoff += (dispwoff - (disphoff * XJ_aspect)) / 2;
+              dispwoff = dispw - (dispxoff * 2);
         }
     }
     else 


More information about the mythtv-dev mailing list