mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Revised 'Fixed a possible deadlock when detaching a receiver from a device' from version 2.3.9, which sometimes caused a black screen when switching channels
This commit is contained in:
		| @@ -3607,3 +3607,6 @@ J | ||||
|  for reporting a possible discrepancy of the primary device number in the LSTD and | ||||
|  PRIM commands | ||||
|  for adding support for EAC3 audio from other sources | ||||
|  | ||||
| Stefan Verse <Verse@amotronics.de> | ||||
|  for fixing an occasional black screen when switching channels | ||||
|   | ||||
							
								
								
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -9463,3 +9463,6 @@ Video Disk Recorder Revision History | ||||
| - Added a device hook for detecting whether a device provides EIT data (thanks to | ||||
|   Winfried K<>hler). | ||||
| - Fixed memory handling in cString::Append() (reported by Stefan Herdler). | ||||
| - Revised 'Fixed a possible deadlock when detaching a receiver from a device' from | ||||
|   version 2.3.9, which sometimes caused a black screen when switching channels | ||||
|   (thanks to Stefan Verse). | ||||
|   | ||||
							
								
								
									
										13
									
								
								device.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								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.31 2020/06/10 14:52:43 kls Exp $ | ||||
|  * $Id: device.c 4.32 2020/06/12 09:28:44 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #include "device.h" | ||||
| @@ -1822,17 +1822,16 @@ void cDevice::Detach(cReceiver *Receiver) | ||||
|   bool receiversLeft = false; | ||||
|   mutexReceiver.Lock(); | ||||
|   for (int i = 0; i < MAXRECEIVERS; i++) { | ||||
|       if (receiver[i] == Receiver) { | ||||
|       if (receiver[i] == Receiver) | ||||
|          receiver[i] = NULL; | ||||
|          Receiver->device = NULL; | ||||
|          Receiver->Activate(false); | ||||
|          for (int n = 0; n < Receiver->numPids; n++) | ||||
|              DelPid(Receiver->pids[n]); | ||||
|          } | ||||
|       else if (receiver[i]) | ||||
|          receiversLeft = true; | ||||
|       } | ||||
|   mutexReceiver.Unlock(); | ||||
|   Receiver->device = NULL; | ||||
|   Receiver->Activate(false); | ||||
|   for (int n = 0; n < Receiver->numPids; n++) | ||||
|       DelPid(Receiver->pids[n]); | ||||
|   if (camSlot) { | ||||
|      if (Receiver->priority > MINPRIORITY) { // priority check to avoid an infinite loop with the CAM slot's caPidReceiver | ||||
|         camSlot->StartDecrypting(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user