diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-03-27 14:12:58 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-03-27 14:12:58 +0200 |
commit | 1387660744be6a00e89e6eb5ee337baed701574c (patch) | |
tree | 5043e77b6fc9c892dbd6bd64eb404d08e56ac12b /dvbsubtitle.c | |
parent | 48d2caa73e023018c5959ca8481dec2c39109e7a (diff) | |
download | vdr-1387660744be6a00e89e6eb5ee337baed701574c.tar.gz vdr-1387660744be6a00e89e6eb5ee337baed701574c.tar.bz2 |
Fixed scaling subtitles in case the OSD size is exactly the same as the display size of the subtitles
Diffstat (limited to 'dvbsubtitle.c')
-rw-r--r-- | dvbsubtitle.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/dvbsubtitle.c b/dvbsubtitle.c index cd296bb9..3e7c1911 100644 --- a/dvbsubtitle.c +++ b/dvbsubtitle.c @@ -7,7 +7,7 @@ * Original author: Marco Schlüßler <marco@lordzodiac.de> * With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi> * - * $Id: dvbsubtitle.c 2.14 2011/03/27 11:52:42 kls Exp $ + * $Id: dvbsubtitle.c 2.15 2011/03/27 13:52:58 kls Exp $ */ #include "dvbsubtitle.h" @@ -870,10 +870,16 @@ void cDvbSubtitleConverter::SetOsdData(void) double VideoAspect; cDevice::PrimaryDevice()->GetOsdSize(OsdWidth, OsdHeight, OsdAspect); cDevice::PrimaryDevice()->GetVideoSize(VideoWidth, VideoHeight, VideoAspect); - osdFactorX = VideoAspect * OsdHeight / displayWidth; - osdFactorY = double(OsdHeight) / displayHeight; - osdDeltaX = (OsdWidth - displayWidth * osdFactorX) / 2; - osdDeltaY = (OsdHeight - displayHeight * osdFactorY) / 2; + if (OsdWidth == displayWidth && OsdHeight == displayHeight) { + osdFactorX = osdFactorY = 1.0; + osdDeltaX = osdDeltaY = 0; + } + else { + osdFactorX = VideoAspect * OsdHeight / displayWidth; + osdFactorY = double(OsdHeight) / displayHeight; + osdDeltaX = (OsdWidth - displayWidth * osdFactorX) / 2; + osdDeltaY = (OsdHeight - displayHeight * osdFactorY) / 2; + } } bool cDvbSubtitleConverter::AssertOsd(void) |