summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2017-03-27 08:35:29 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2017-03-27 08:35:29 +0200
commit44813e56a5aa82a86225dc7e9cfa619929e129b5 (patch)
treed457d62e82b253c571a49f3aba0281d96ba78d8a
parentb313d88db13d1e90f81f9967af1fba8c8f84e59d (diff)
downloadvdr-44813e56a5aa82a86225dc7e9cfa619929e129b5.tar.gz
vdr-44813e56a5aa82a86225dc7e9cfa619929e129b5.tar.bz2
Limiting locking the mtdBuffer to reading and clearing
-rw-r--r--mtd.c7
-rw-r--r--mtd.h4
2 files changed, 5 insertions, 6 deletions
diff --git a/mtd.c b/mtd.c
index a170cbc9..acc3c705 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.6 2017/03/26 13:01:32 kls Exp $
+ * $Id: mtd.c 1.7 2017/03/27 08:35:29 kls Exp $
*/
#include "mtd.h"
@@ -278,7 +278,7 @@ void cMtdCamSlot::StopDecrypting(void)
cCamSlot::StopDecrypting();
if (!MasterSlot()->IsDecrypting())
MasterSlot()->StopDecrypting();
- cMutexLock MutexLock(&mutex);
+ cMutexLock MutexLock(&clearMutex);
mtdMapper->Clear();
mtdBuffer->Clear();
delivered = false;
@@ -298,7 +298,7 @@ uchar *cMtdCamSlot::Decrypt(uchar *Data, int &Count)
else
Count = 0;
// Drop delivered data from previous call:
- cMutexLock MutexLock(&mutex);
+ cMutexLock MutexLock(&clearMutex);
if (delivered) {
mtdBuffer->Del(TS_SIZE);
delivered = false;
@@ -323,7 +323,6 @@ uchar *cMtdCamSlot::Decrypt(uchar *Data, int &Count)
int cMtdCamSlot::PutData(const uchar *Data, int Count)
{
- cMutexLock MutexLock(&mutex);
int Free = mtdBuffer->Free();
Free -= Free % TS_SIZE;
if (Free < TS_SIZE)
diff --git a/mtd.h b/mtd.h
index ea62f426..b7742022 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.5 2017/03/25 14:47:03 kls Exp $
+ * $Id: mtd.h 1.6 2017/03/27 08:30:00 kls Exp $
*/
#ifndef __MTD_H
@@ -151,7 +151,7 @@ void MtdMapPid(uchar *p, cMtdMapper *MtdMapper);
class cMtdCamSlot : public cCamSlot {
private:
- cMutex mutex;
+ cMutex clearMutex;
cMtdMapper *mtdMapper;
cRingBufferLinear *mtdBuffer;
bool delivered;