summaryrefslogtreecommitdiff
path: root/spuencoder.c
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2009-09-01 14:31:24 +0200
committerChristian Gmeiner <christian.gmeiner@gmail.com>2009-09-01 14:31:24 +0200
commit3bd41879d4a8929ff0686ebb53c9c7c4016c9d32 (patch)
treecd361786822446ac88b00725e7bef9efb0f389d2 /spuencoder.c
parenta484bd02a29cc5856c3c9a0e93b5eddced7c9b09 (diff)
downloadvdr-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.c15
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);
+ }
+}