Ticket #4704: preview_pixelaspect.diff
File preview_pixelaspect.diff, 1.3 KB (added by , 16 years ago) |
---|
-
mythtv/programs/mythfrontend/playbackbox.cpp
32 32 #include "oldsettings.h" 33 33 #include "NuppelVideoPlayer.h" 34 34 35 #include "util.h" 36 #include "util-x11.h" 35 37 #include "exitcodes.h" 36 38 #include "mythcontext.h" 37 39 #include "mythdbcon.h" … … 4625 4627 4626 4628 float boundsaspect = 4.0f / 3.0f; 4627 4629 float imageaspect = 4.0f / 3.0f; 4630 float pixelaspect = MythGetPixelAspectRatio(); 4631 4632 if (GetNumberOfXineramaScreens() > 1) 4633 { 4634 pixelaspect = gContext->GetFloatSettingOnHost( 4635 "XineramaMonitorAspectRatio", gContext->GetHostName(), 1.0f); 4636 } 4637 4628 4638 QSize previewSize = bounds; 4629 4639 4630 4640 if ((bounds.width() > 0) && (bounds.height() > 0)) … … 4633 4643 if ((imageSize.width() > 0) && (imageSize.height() > 0)) 4634 4644 imageaspect = ((float)imageSize.width()) / ((float)imageSize.height()); 4635 4645 4646 if ((int)((boundsaspect + 0.05f) * 10) < (int)((pixelaspect + 0.05f) * 10)) 4647 boundsaspect = boundsaspect * pixelaspect; 4648 4636 4649 // Calculate new height or width according to relative aspect ratio 4637 4650 if ((int)((boundsaspect + 0.05f) * 10) > 4638 4651 (int)((imageaspect + 0.05f) * 10))