diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-01 14:31:24 +0200 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-01 14:31:24 +0200 |
commit | 3bd41879d4a8929ff0686ebb53c9c7c4016c9d32 (patch) | |
tree | cd361786822446ac88b00725e7bef9efb0f389d2 /spuencoder.c | |
parent | a484bd02a29cc5856c3c9a0e93b5eddced7c9b09 (diff) | |
download | vdr-plugin-dxr3-3bd41879d4a8929ff0686ebb53c9c7c4016c9d32.tar.gz vdr-plugin-dxr3-3bd41879d4a8929ff0686ebb53c9c7c4016c9d32.tar.bz2 |
add method writeNibble and all needed members to cSpuEncoder
Diffstat (limited to 'spuencoder.c')
-rw-r--r-- | spuencoder.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spuencoder.c b/spuencoder.c index 965683a..d61b462 100644 --- a/spuencoder.c +++ b/spuencoder.c @@ -65,3 +65,18 @@ void cSpuEncoder::clearOsd() cDxr3Interface::instance()->WriteSpu((uchar *)&d, 10); } + +void cSpuEncoder::writeNibble(uint8_t val) { + + // look if we have an overflow + if (written == MAX_SPU_DATA) { + throw "overflow"; + } + + if (ncnt++ & 1) { + *p++ = nholder | ((val) & 0x0f); + written++; + } else { + nholder = (val << 4); + } +} |