diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2011-03-12 13:09:30 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2011-03-12 13:09:30 +0100 |
commit | 11cca8015c0c1b66a9a4bb9255ab0b1183cca529 (patch) | |
tree | c8d400dfda1f60dac1c46deaa1e266fac1f41156 | |
parent | 39c0065fe09d07a2248fd46d6a0f4f1d64ff369f (diff) | |
download | vdr-11cca8015c0c1b66a9a4bb9255ab0b1183cca529.tar.gz vdr-11cca8015c0c1b66a9a4bb9255ab0b1183cca529.tar.bz2 |
Now storing the original display size when handling DVB subtitles
-rw-r--r-- | CONTRIBUTORS | 1 | ||||
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | dvbsubtitle.c | 36 | ||||
-rw-r--r-- | dvbsubtitle.h | 8 |
4 files changed, 26 insertions, 21 deletions
diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a3c98c1e..74090c21 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -1263,6 +1263,7 @@ Reinhard Nissl <rnissl@gmx.de> for fixing DDS detection for HD resolution subtitles for some valuable input during development of the TrueColor OSD, help with debugging, and an implementation of the AlphaBlend() function. + for storing the original display size when handling DVB subtitles Richard Robson <richard_robson@beeb.net> for reporting freezing replay if a timer starts while in Transfer Mode from the @@ -6552,3 +6552,5 @@ Video Disk Recorder Revision History - Removed checking for minimum line length of 21 characters in the LIRC receiver code (reported by Gerald Dachs). - Updated the Romanian OSD texts (thanks to Lucian Muresan). +- Now storing the original display size when handling DVB subtitles (thanks to + Reinhard Nissl). diff --git a/dvbsubtitle.c b/dvbsubtitle.c index 98a45188..3e7ffa6b 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.9 2011/02/25 15:13:32 kls Exp $ + * $Id: dvbsubtitle.c 2.10 2011/03/12 13:07:59 kls Exp $ */ #include "dvbsubtitle.h" @@ -666,10 +666,10 @@ cDvbSubtitleConverter::cDvbSubtitleConverter(void) osd = NULL; frozen = false; ddsVersionNumber = -1; - displayWidth = 720; - displayHeight = 576; - displayHorizontalOffset = 0; - displayVerticalOffset = 0; + displayWidth = windowWidth = 720; + displayHeight = windowHeight = 576; + windowHorizontalOffset = 0; + windowVerticalOffset = 0; pages = new cList<cDvbSubtitlePage>; bitmaps = new cList<cDvbSubtitleBitmaps>; Start(); @@ -699,10 +699,10 @@ void cDvbSubtitleConverter::Reset(void) DELETENULL(osd); frozen = false; ddsVersionNumber = -1; - displayWidth = 720; - displayHeight = 576; - displayHorizontalOffset = 0; - displayVerticalOffset = 0; + displayWidth = windowWidth = 720; + displayHeight = windowHeight = 576; + windowHorizontalOffset = 0; + windowVerticalOffset = 0; Unlock(); } @@ -852,7 +852,7 @@ tColor cDvbSubtitleConverter::yuv2rgb(int Y, int Cb, int Cr) bool cDvbSubtitleConverter::AssertOsd(void) { - return osd || (osd = cOsdProvider::NewOsd(displayHorizontalOffset, displayVerticalOffset + Setup.SubtitleOffset, OSD_LEVEL_SUBTITLES)); + return osd || (osd = cOsdProvider::NewOsd(windowHorizontalOffset, windowVerticalOffset + Setup.SubtitleOffset, OSD_LEVEL_SUBTITLES)); } int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t Pts) @@ -1016,15 +1016,15 @@ int cDvbSubtitleConverter::ExtractSegment(const uchar *Data, int Length, int64_t int version = (Data[6] & 0xF0) >> 4; if (version != ddsVersionNumber) { int displayWindowFlag = (Data[6] & 0x08) >> 3; - displayHorizontalOffset = 0; - displayVerticalOffset = 0; - displayWidth = ((Data[7] << 8) | Data[8]) + 1; - displayHeight = ((Data[9] << 8) | Data[10]) + 1; + windowHorizontalOffset = 0; + windowVerticalOffset = 0; + displayWidth = windowWidth = ((Data[7] << 8) | Data[8]) + 1; + displayHeight = windowHeight = ((Data[9] << 8) | Data[10]) + 1; if (displayWindowFlag) { - displayHorizontalOffset = (Data[11] << 8) | Data[12]; // displayWindowHorizontalPositionMinimum - displayWidth = ((Data[13] << 8) | Data[14]) - displayHorizontalOffset + 1; // displayWindowHorizontalPositionMaximum - displayVerticalOffset = (Data[15] << 8) | Data[16]; // displayWindowVerticalPositionMinimum - displayHeight = ((Data[17] << 8) | Data[18]) - displayVerticalOffset + 1; // displayWindowVerticalPositionMaximum + windowHorizontalOffset = (Data[11] << 8) | Data[12]; // displayWindowHorizontalPositionMinimum + windowWidth = ((Data[13] << 8) | Data[14]) - windowHorizontalOffset + 1; // displayWindowHorizontalPositionMaximum + windowVerticalOffset = (Data[15] << 8) | Data[16]; // displayWindowVerticalPositionMinimum + windowHeight = ((Data[17] << 8) | Data[18]) - windowVerticalOffset + 1; // displayWindowVerticalPositionMaximum } SetupChanged(); ddsVersionNumber = version; diff --git a/dvbsubtitle.h b/dvbsubtitle.h index 68886610..69572b49 100644 --- a/dvbsubtitle.h +++ b/dvbsubtitle.h @@ -6,7 +6,7 @@ * * Original author: Marco Schlüßler <marco@lordzodiac.de> * - * $Id: dvbsubtitle.h 2.3 2010/05/13 14:43:44 kls Exp $ + * $Id: dvbsubtitle.h 2.4 2011/03/12 13:07:59 kls Exp $ */ #ifndef __DVBSUBTITLE_H @@ -29,8 +29,10 @@ private: int ddsVersionNumber; int displayWidth; int displayHeight; - int displayHorizontalOffset; - int displayVerticalOffset; + int windowHorizontalOffset; + int windowVerticalOffset; + int windowWidth; + int windowHeight; cList<cDvbSubtitlePage> *pages; cList<cDvbSubtitleBitmaps> *bitmaps; tColor yuv2rgb(int Y, int Cb, int Cr); |