diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-22 10:39:41 +0200 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-22 10:39:41 +0200 |
commit | b2b3a3f6689cff4dbf719138d824045f32041d6d (patch) | |
tree | 58a0affc9c755d999c6deabff22c89ab3bafe4ca /spuencoder.c | |
parent | 4a6f01dfb2e1babf8b2c24e5961190009fdd2f0a (diff) | |
download | vdr-plugin-dxr3-b2b3a3f6689cff4dbf719138d824045f32041d6d.tar.gz vdr-plugin-dxr3-b2b3a3f6689cff4dbf719138d824045f32041d6d.tar.bz2 |
use section method to get a pointer to a valid sSection or NULL
Diffstat (limited to 'spuencoder.c')
-rw-r--r-- | spuencoder.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/spuencoder.c b/spuencoder.c index 18749f9..811422f 100644 --- a/spuencoder.c +++ b/spuencoder.c @@ -142,19 +142,19 @@ void cSpuEncoder::writeNibble(uint8_t val) } } -void cSpuEncoder::writeColorAndAlpha(sSection &sec, bool withCMD) +void cSpuEncoder::writeColorAndAlpha(sSection *sec, bool withCMD) { if (withCMD) { spu[written++] = CMD_SET_COLOR; } - spu[written++] = (sec.colIndex[0] << 4) | (sec.colIndex[1] & 0x0f); - spu[written++] = (sec.colIndex[2] << 4) | (sec.colIndex[3] & 0x0f); + spu[written++] = (sec->colIndex[0] << 4) | (sec->colIndex[1] & 0x0f); + spu[written++] = (sec->colIndex[2] << 4) | (sec->colIndex[3] & 0x0f); if (withCMD) { spu[written++] = CMD_SET_ALPHA; } - spu[written++] = (opacity[sec.colIndex[0]] << 4) | (opacity[sec.colIndex[1]] & 0x0f); - spu[written++] = (opacity[sec.colIndex[2]] << 4) | (opacity[sec.colIndex[3]] & 0x0f); + spu[written++] = (opacity[sec->colIndex[0]] << 4) | (opacity[sec->colIndex[1]] & 0x0f); + spu[written++] = (opacity[sec->colIndex[2]] << 4) | (opacity[sec->colIndex[3]] & 0x0f); } void cSpuEncoder::writeRegionInformation() @@ -177,13 +177,13 @@ void cSpuEncoder::writeRegionInformation() 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 (size_t j = 0; j < reg->openSections(); j++) { - sSection sec = reg->sections[i]; + sSection *sec = reg->section(i); // define section (PXCTLI) - spu[written++] = (sec.startColumn >> 8) & 0x0f; - spu[written++] = sec.startColumn & 0xff; + spu[written++] = (sec->startColumn >> 8) & 0x0f; + spu[written++] = sec->startColumn & 0xff; // write color and alpha writeColorAndAlpha(sec, false); @@ -290,7 +290,7 @@ void cSpuEncoder::generateSpuData(bool topAndBottom) throw (char const* ) spu[written++] = bottomStart & 0xff; // write color-> palette index and alpha data for the first region - writeColorAndAlpha(regions.front()->sections[0], true); + writeColorAndAlpha(regions.front()->section(0), true); // write informations for other regions if (regions.size() > 1) { |