From 3f9cdea1c16cb25b7a3ce7c875d46e6d100d593d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Tue, 21 Feb 2017 14:17:07 +0100 Subject: PIDs can now be added to and deleted from a cReceiver while it is attached to a cDevice --- device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'device.c') diff --git a/device.c b/device.c index 2b350e86..0c8b0018 100644 --- a/device.c +++ b/device.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: device.c 4.6 2017/01/23 11:43:05 kls Exp $ + * $Id: device.c 4.7 2017/02/21 13:38:01 kls Exp $ */ #include "device.h" @@ -451,6 +451,7 @@ void cDevice::GetOsdSize(int &Width, int &Height, double &PixelAspect) bool cDevice::HasPid(int Pid) const { + cMutexLock MutexLock(&mutexPids); for (int i = 0; i < MAXPIDHANDLES; i++) { if (pidHandles[i].pid == Pid) return true; @@ -460,6 +461,7 @@ bool cDevice::HasPid(int Pid) const bool cDevice::AddPid(int Pid, ePidType PidType, int StreamType) { + cMutexLock MutexLock(&mutexPids); if (Pid || PidType == ptPcr) { int n = -1; int a = -1; @@ -524,6 +526,7 @@ bool cDevice::AddPid(int Pid, ePidType PidType, int StreamType) void cDevice::DelPid(int Pid, ePidType PidType) { + cMutexLock MutexLock(&mutexPids); if (Pid || PidType == ptPcr) { int n = -1; if (PidType == ptPcr) @@ -559,6 +562,7 @@ bool cDevice::SetPid(cPidHandle *Handle, int Type, bool On) void cDevice::DelLivePids(void) { + cMutexLock MutexLock(&mutexPids); for (int i = ptAudio; i < ptOther; i++) { if (pidHandles[i].pid) DelPid(pidHandles[i].pid, ePidType(i)); -- cgit v1.2.3