summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2010-06-05 14:03:55 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2010-06-05 14:03:55 +0200
commitfd426098833db48e77e1ce55ea67b7cb8ad3d5fe (patch)
tree7c8f9ceeecbd0bdebea42edd5d7e069674560b4f
parent9377d831b3db032990dd71b1969713b8e361860a (diff)
downloadvdr-fd426098833db48e77e1ce55ea67b7cb8ad3d5fe.tar.gz
vdr-fd426098833db48e77e1ce55ea67b7cb8ad3d5fe.tar.bz2
Implemented handling of HD resolution subtitles according to v1.3.1 of ETSI EN 300 743, chapter 7.2.1 (cont'd)
-rw-r--r--dvbsubtitle.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/dvbsubtitle.c b/dvbsubtitle.c
index c5544316..6ecb3b78 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.5 2010/05/13 14:43:44 kls Exp $
+ * $Id: dvbsubtitle.c 2.6 2010/06/05 14:03:55 kls Exp $
*/
#include "dvbsubtitle.h"
@@ -1017,10 +1017,16 @@ 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;
- displayWidth = (Data[7] << 8) | Data[8];
- displayHeight = (Data[9] << 8) | Data[10];
- displayHorizontalOffset = displayWindowFlag ? Data[11] : 0; // displayWindowHorizontalPositionMinimum
- displayVerticalOffset = displayWindowFlag ? Data[13] : 0; // displayWindowVerticalPositionMinimum
+ displayHorizontalOffset = 0;
+ displayVerticalOffset = 0;
+ displayWidth = ((Data[7] << 8) | Data[8]) + 1;
+ displayHeight = ((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
+ }
SetupChanged();
ddsVersionNumber = version;
}