[mythtv] [PATCH] Potential display aspect ratio patch for non-4:3

Kenneth Aafl°y ke-aa at frisurf.no
Mon Feb 2 10:25:40 EST 2004

Chris Pinkham wrote:
> > > 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.
> 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).
> 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).

Yea, but you're assuming square pixels, which need not be the case.
Maybe it's better to calculate the pixel ratio from DisplaySize?

My 2 cents,

More information about the mythtv-dev mailing list