mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Limiting locking the mtdBuffer to reading and clearing
This commit is contained in:
parent
b313d88db1
commit
44813e56a5
7
mtd.c
7
mtd.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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"
|
#include "mtd.h"
|
||||||
@ -278,7 +278,7 @@ void cMtdCamSlot::StopDecrypting(void)
|
|||||||
cCamSlot::StopDecrypting();
|
cCamSlot::StopDecrypting();
|
||||||
if (!MasterSlot()->IsDecrypting())
|
if (!MasterSlot()->IsDecrypting())
|
||||||
MasterSlot()->StopDecrypting();
|
MasterSlot()->StopDecrypting();
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&clearMutex);
|
||||||
mtdMapper->Clear();
|
mtdMapper->Clear();
|
||||||
mtdBuffer->Clear();
|
mtdBuffer->Clear();
|
||||||
delivered = false;
|
delivered = false;
|
||||||
@ -298,7 +298,7 @@ uchar *cMtdCamSlot::Decrypt(uchar *Data, int &Count)
|
|||||||
else
|
else
|
||||||
Count = 0;
|
Count = 0;
|
||||||
// Drop delivered data from previous call:
|
// Drop delivered data from previous call:
|
||||||
cMutexLock MutexLock(&mutex);
|
cMutexLock MutexLock(&clearMutex);
|
||||||
if (delivered) {
|
if (delivered) {
|
||||||
mtdBuffer->Del(TS_SIZE);
|
mtdBuffer->Del(TS_SIZE);
|
||||||
delivered = false;
|
delivered = false;
|
||||||
@ -323,7 +323,6 @@ uchar *cMtdCamSlot::Decrypt(uchar *Data, int &Count)
|
|||||||
|
|
||||||
int cMtdCamSlot::PutData(const uchar *Data, int Count)
|
int cMtdCamSlot::PutData(const uchar *Data, int Count)
|
||||||
{
|
{
|
||||||
cMutexLock MutexLock(&mutex);
|
|
||||||
int Free = mtdBuffer->Free();
|
int Free = mtdBuffer->Free();
|
||||||
Free -= Free % TS_SIZE;
|
Free -= Free % TS_SIZE;
|
||||||
if (Free < TS_SIZE)
|
if (Free < TS_SIZE)
|
||||||
|
4
mtd.h
4
mtd.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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
|
#ifndef __MTD_H
|
||||||
@ -151,7 +151,7 @@ void MtdMapPid(uchar *p, cMtdMapper *MtdMapper);
|
|||||||
|
|
||||||
class cMtdCamSlot : public cCamSlot {
|
class cMtdCamSlot : public cCamSlot {
|
||||||
private:
|
private:
|
||||||
cMutex mutex;
|
cMutex clearMutex;
|
||||||
cMtdMapper *mtdMapper;
|
cMtdMapper *mtdMapper;
|
||||||
cRingBufferLinear *mtdBuffer;
|
cRingBufferLinear *mtdBuffer;
|
||||||
bool delivered;
|
bool delivered;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user