Ticket #4704: preview_pixelaspect.diff

File preview_pixelaspect.diff, 1.3 KB (added by stuartm, 16 years ago)
  • mythtv/programs/mythfrontend/playbackbox.cpp

     
    3232#include "oldsettings.h"
    3333#include "NuppelVideoPlayer.h"
    3434
     35#include "util.h"
     36#include "util-x11.h"
    3537#include "exitcodes.h"
    3638#include "mythcontext.h"
    3739#include "mythdbcon.h"
     
    46254627
    46264628    float boundsaspect  = 4.0f / 3.0f;
    46274629    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
    46284638    QSize previewSize   = bounds;
    46294639
    46304640    if ((bounds.width() > 0) && (bounds.height() > 0))
     
    46334643    if ((imageSize.width() > 0) && (imageSize.height() > 0))
    46344644        imageaspect = ((float)imageSize.width()) / ((float)imageSize.height());
    46354645
     4646    if ((int)((boundsaspect + 0.05f) * 10) < (int)((pixelaspect  + 0.05f) * 10))
     4647        boundsaspect = boundsaspect * pixelaspect;
     4648
    46364649    // Calculate new height or width according to relative aspect ratio
    46374650    if ((int)((boundsaspect + 0.05f) * 10) >
    46384651        (int)((imageaspect  + 0.05f) * 10))