[mythtv] [PATCH] Potential display aspect ratio patch for non-4:3
Chris Pinkham
cpinkham at bc2va.org
Mon Feb 2 10:02:35 EST 2004
> >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.
>
> Remember that you can also set "DisplaySize" in your xf86config file in
> order to tell it what the REAL aspect ratio is of your screen. For
> example I can only get my tvout to work in 720x576 instead of 768x576
> and so I set the DisplaySize variable and now mplayer, myth, etc all get
> the video display aspect just perfect.
The width and height in MM that Myth is getting are correct though. Why would
I want to fudge the numbers in my XF86Config file to fix Myth? My screen
actually is a 1280:800 (ie, 1.6:1) ratio screen. It is a widescreen laptop
by Dell (although you could also think of it as a 1280x1024 screen with
the bottom 2 inches chopped off). :) The code currently assumes
anything that's not 4:3 is 16:9. When I display full-screen on the 1280x800
display, a 4:3 image should be displayed at 1066x800 pixels (4:3). The
current code puts in black bars on each side that are ~200 pixels wide which
makes the actuall image displayed 880x800 which is almost a square. My
calculation would put in black bars which are ~107 pixels wide giving a
display area of 1066x800 which is 4:3. On a 16:9 ratio screen (for example
1600x900) it would still give the correct size black bars as well (in this
instance 200 pixels wide each).
formula is:
dispxoff += (dispwoff - (disphoff * XJ_aspect)) / 2;
(1600 - (900 * 4/3)) / 2 = 200 (16:9 actual screen has 200 pixel borders)
(1280 - (800 * 4/3)) / 2 = 107 (1280x800 screen has 106 pixel borders)
(640 - (480 * 4/3)) / 2 = 0 (640x480 screen has 0 borders
It seems like the replacement calculation I made in the code will work no
matter what the aspect ratio is because it calculates rather than assuming
16:9, but I'd like to for someone with a 16:9 screen to test (or anyone
with non-16:9 screens as well).
--
Chris
More information about the mythtv-dev
mailing list