From fd426098833db48e77e1ce55ea67b7cb8ad3d5fe Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sat, 5 Jun 2010 14:03:55 +0200 Subject: Implemented handling of HD resolution subtitles according to v1.3.1 of ETSI EN 300 743, chapter 7.2.1 (cont'd) --- dvbsubtitle.c | 16 +++++++++++----- 1 file 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 * With some input from the "subtitle plugin" by Pekka Virtanen * - * $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; } -- cgit v1.2.3