1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Fixed a race between SVDRP CHAN and cDevice::HasProgramme()

This commit is contained in:
Klaus Schmidinger 2017-05-18 09:18:43 +02:00
parent b01a1ee818
commit 43c828f8ca
3 changed files with 7 additions and 2 deletions

View File

@ -3397,6 +3397,7 @@ Dietmar Spingler <d_spingler@gmx.de>
for suggesting to cache the channel/CAM relations in the file 'cam.data' for suggesting to cache the channel/CAM relations in the file 'cam.data'
for suggesting to optionally list the channels with channel ids in the SVDRP command LSTC for suggesting to optionally list the channels with channel ids in the SVDRP command LSTC
for suggesting to include the channel ID in log messages about switching channels for suggesting to include the channel ID in log messages about switching channels
for reporting a problem with the SVDRP command CHAN while the channel display is open
Stefan Schallenberg <infos@nafets.de> Stefan Schallenberg <infos@nafets.de>
for adding the functions IndexOf(), InsertUnique(), AppendUnique() and RemoveElement() for adding the functions IndexOf(), InsertUnique(), AppendUnique() and RemoveElement()

View File

@ -8991,7 +8991,7 @@ Video Disk Recorder Revision History
current channel is listed. current channel is listed.
- Fixed a possible crash when pulling the CAM while decrypting a channel with MTD. - Fixed a possible crash when pulling the CAM while decrypting a channel with MTD.
2017-05-17: Version 2.3.5 2017-05-18: Version 2.3.5
- CAMs are now sent a generated EIT packet that contains a single 'present event' for - CAMs are now sent a generated EIT packet that contains a single 'present event' for
the current SID, in order to avoid any parental rating dialogs. the current SID, in order to avoid any parental rating dialogs.
@ -9026,3 +9026,5 @@ Video Disk Recorder Revision History
presence is required by some CAMs). presence is required by some CAMs).
- Fixed a crash in case the bottom text of a CAM menu is empty. - Fixed a crash in case the bottom text of a CAM menu is empty.
- Extended the CI API to allow plugins to implement additional CAM resources. - Extended the CI API to allow plugins to implement additional CAM resources.
- Fixed a race between SVDRP CHAN and cDevice::HasProgramme() (reported by Dietmar
Spingler).

View File

@ -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: device.c 4.20 2017/05/18 09:05:46 kls Exp $ * $Id: device.c 4.21 2017/05/18 09:16:41 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -834,6 +834,7 @@ bool cDevice::SwitchChannel(int Direction)
eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView) eSetChannelResult cDevice::SetChannel(const cChannel *Channel, bool LiveView)
{ {
cMutexLock MutexLock(&mutexReceiver); // to avoid a race between SVDRP CHAN and HasProgramme()
cStatus::MsgChannelSwitch(this, 0, LiveView); cStatus::MsgChannelSwitch(this, 0, LiveView);
if (LiveView) { if (LiveView) {
@ -946,6 +947,7 @@ bool cDevice::HasLock(int TimeoutMs) const
bool cDevice::HasProgramme(void) const bool cDevice::HasProgramme(void) const
{ {
cMutexLock MutexLock(&mutexReceiver); // to avoid a race between SVDRP CHAN and HasProgramme()
return Replaying() || pidHandles[ptAudio].pid || pidHandles[ptVideo].pid; return Replaying() || pidHandles[ptAudio].pid || pidHandles[ptVideo].pid;
} }