Fixed scaling subtitles in case the OSD size is exactly the same as the display size of the subtitles

This commit is contained in:
Klaus Schmidinger 2011-03-27 14:12:58 +02:00
parent 48d2caa73e
commit 1387660744
2 changed files with 13 additions and 5 deletions

View File

@ -6580,3 +6580,5 @@ Video Disk Recorder Revision History
- Fixed the description of cReceiver in PLUGINS.html, regarding detaching a receiver - Fixed the description of cReceiver in PLUGINS.html, regarding detaching a receiver
from its device before deleting it (reported by Winfried Köhler). This change in from its device before deleting it (reported by Winfried Köhler). This change in
behavior was introduced in version 1.5.7. behavior was introduced in version 1.5.7.
- Fixed scaling subtitles in case the OSD size is exactly the same as the display
size of the subtitles.

View File

@ -7,7 +7,7 @@
* Original author: Marco Schlüßler <marco@lordzodiac.de> * Original author: Marco Schlüßler <marco@lordzodiac.de>
* With some input from the "subtitle plugin" by Pekka Virtanen <pekka.virtanen@sci.fi> * 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" #include "dvbsubtitle.h"
@ -870,10 +870,16 @@ void cDvbSubtitleConverter::SetOsdData(void)
double VideoAspect; double VideoAspect;
cDevice::PrimaryDevice()->GetOsdSize(OsdWidth, OsdHeight, OsdAspect); cDevice::PrimaryDevice()->GetOsdSize(OsdWidth, OsdHeight, OsdAspect);
cDevice::PrimaryDevice()->GetVideoSize(VideoWidth, VideoHeight, VideoAspect); cDevice::PrimaryDevice()->GetVideoSize(VideoWidth, VideoHeight, VideoAspect);
osdFactorX = VideoAspect * OsdHeight / displayWidth; if (OsdWidth == displayWidth && OsdHeight == displayHeight) {
osdFactorY = double(OsdHeight) / displayHeight; osdFactorX = osdFactorY = 1.0;
osdDeltaX = (OsdWidth - displayWidth * osdFactorX) / 2; osdDeltaX = osdDeltaY = 0;
osdDeltaY = (OsdHeight - displayHeight * osdFactorY) / 2; }
else {
osdFactorX = VideoAspect * OsdHeight / displayWidth;
osdFactorY = double(OsdHeight) / displayHeight;
osdDeltaX = (OsdWidth - displayWidth * osdFactorX) / 2;
osdDeltaY = (OsdHeight - displayHeight * osdFactorY) / 2;
}
} }
bool cDvbSubtitleConverter::AssertOsd(void) bool cDvbSubtitleConverter::AssertOsd(void)