summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-03-19 13:33:53 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2017-03-19 13:33:53 +0100
commite2756f8e9ad544ff085a44a0e26338257172e85a (patch)
tree4a44bca60a5f67993a9e31bcf0cdc2bc7f0736b0
parent367557039aae419f28c2ff44700f77bec8f498e4 (diff)
downloadvdr-e2756f8e9ad544ff085a44a0e26338257172e85a.tar.gz
vdr-e2756f8e9ad544ff085a44a0e26338257172e85a.tar.bz2
Now clearing the MTD buffer
-rw-r--r--mtd.c9
-rw-r--r--mtd.h3
2 files changed, 9 insertions, 3 deletions
diff --git a/mtd.c b/mtd.c
index 1ae2ccff..0de0a041 100644
--- a/mtd.c
+++ b/mtd.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: mtd.c 1.1 2017/03/18 14:31:34 kls Exp $
+ * $Id: mtd.c 1.2 2017/03/19 13:33:53 kls Exp $
*/
#include "mtd.h"
@@ -223,6 +223,7 @@ cMtdCamSlot::cMtdCamSlot(cCamSlot *MasterSlot, int Index)
mtdBuffer = new cRingBufferLinear(MTD_BUFFER_SIZE, TS_SIZE, true, "MTD buffer");
mtdMapper = new cMtdMapper(Index + 1, MasterSlot->SlotNumber());
delivered = false;
+ clearBuffer = false;
ciAdapter = MasterSlot->ciAdapter; // we don't pass the CI adapter in the constructor, to prevent this one from being inserted into CamSlots
}
@@ -271,7 +272,7 @@ void cMtdCamSlot::StopDecrypting(void)
{
cCamSlot::StopDecrypting();
mtdMapper->Clear();
- //XXX mtdBuffer->Clear(); //XXX would require locking?
+ clearBuffer = true;
}
bool cMtdCamSlot::IsDecrypting(void)
@@ -297,6 +298,10 @@ uchar *cMtdCamSlot::Decrypt(uchar *Data, int &Count)
mtdBuffer->Del(TS_SIZE);
delivered = false;
}
+ if (clearBuffer) {
+ mtdBuffer->Clear();
+ clearBuffer = false;
+ }
// Receive data from buffer:
int c = 0;
uchar *d = mtdBuffer->Get(c);
diff --git a/mtd.h b/mtd.h
index 9375b682..b9cf55ae 100644
--- a/mtd.h
+++ b/mtd.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: mtd.h 1.2 2017/03/19 10:48:52 kls Exp $
+ * $Id: mtd.h 1.3 2017/03/19 13:32:48 kls Exp $
*/
#ifndef __MTD_H
@@ -154,6 +154,7 @@ private:
cMtdMapper *mtdMapper;
cRingBufferLinear *mtdBuffer;
bool delivered;
+ bool clearBuffer;
protected:
virtual const int *GetCaSystemIds(void);
virtual void SendCaPmt(uint8_t CmdId);