diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-29 17:19:56 +0200 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-29 17:19:56 +0200 |
commit | d79f880ef6f91614d2257c5bef158678ea9a387f (patch) | |
tree | b4116210a95ce8c0021d7bce4ccd024fb8268d17 | |
parent | a5b7097da6f19c3c6b260f4675c55e83c6db9285 (diff) | |
download | vdr-plugin-dxr3-d79f880ef6f91614d2257c5bef158678ea9a387f.tar.gz vdr-plugin-dxr3-d79f880ef6f91614d2257c5bef158678ea9a387f.tar.bz2 |
correct writeRegionInformation
-rw-r--r-- | spuencoder.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/spuencoder.c b/spuencoder.c index d4f1e8a..a78424d 100644 --- a/spuencoder.c +++ b/spuencoder.c @@ -182,18 +182,28 @@ void cSpuEncoder::writeRegionInformation() spu[written++] = 0x00; // total size of parameter area spu[written++] = 0x00; // will be filled later - for (size_t i = 1; i < regions.size(); i++) { + for (size_t i = 0; i < regions.size(); i++) { cSpuRegion *reg = regions[i]; + // we need to modify start and end line + // because both are values for the whole screen and + // we are working only on the bitmap to show. + // se simply add top coordinate to startLine and endLine + reg->startLine += this->top; + reg->endLine += this->top - 1; + // define region (LN_CTLI) spu[written++] = (reg->startLine >> 8); spu[written++] = reg->startLine & 0xff; spu[written++] = (((reg->openSections() & 0x0f) << 4)| ((reg->endLine >> 8) & 0x0f)); spu[written++] = reg->endLine & 0xff; - for (size_t j = 0; j < reg->openSections(); j++) { + for (uint8_t j = 0; j < reg->openSections(); j++) { + + sSection *sec = reg->section(j); - sSection *sec = reg->section(i); + // we also need to modify startColumn value + sec->startColumn += this->left; // define section (PXCTLI) spu[written++] = (sec->startColumn >> 8) & 0x0f; |