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

Fixed a possible invalid locking sequence in case a remote timer handling error message is displayed on the OSD and the skin tries to lock the Recordings or DeletedRecordings list in its Flush() function

This commit is contained in:
Klaus Schmidinger 2018-04-28 12:17:22 +02:00
parent d84ec07ff6
commit 820a0ddb8a
4 changed files with 21 additions and 7 deletions

View File

@ -9348,7 +9348,14 @@ Video Disk Recorder Revision History
Senzel). Senzel).
- Official release. - Official release.
2018-04-19: Version 2.4.1 2018-04-28: Version 2.4.1
- Fixed handling the tfRecording flag in the SVDRP commands MODT and UPDT (reported - Fixed handling the tfRecording flag in the SVDRP commands MODT and UPDT (reported
by Johann Friedrichs). by Johann Friedrichs).
- Fixed a possible invalid locking sequence in case a remote timer handling error message
is displayed on the OSD and the skin tries to lock the Recordings or DeletedRecordings
list in its Flush() function (for instance by calling cVideoDiskUsage::HasChanged()).
To do this, the call to Skins.Message() in menu.c's HandleRemoteModifications() has
been changed to Skins.QueueMessage(), and cSkins::ProcessQueuedMessages() is now called
unconditionally in the main loop, and checks whether the current cSkinDisplay object
(if any) implements SetMessage().

4
menu.c
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: menu.c 4.74 2018/04/14 10:24:41 kls Exp $ * $Id: menu.c 4.75 2018/04/28 12:09:45 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -1075,7 +1075,7 @@ static bool HandleRemoteModifications(cTimer *NewTimer, cTimer *OldTimer = NULL)
{ {
cString ErrorMessage; cString ErrorMessage;
if (!HandleRemoteTimerModifications(NewTimer, OldTimer, &ErrorMessage)) { if (!HandleRemoteTimerModifications(NewTimer, OldTimer, &ErrorMessage)) {
Skins.Message(mtError, ErrorMessage); Skins.QueueMessage(mtError, ErrorMessage);
return false; return false;
} }
return true; return true;

10
skins.c
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: skins.c 3.1 2013/08/18 12:07:22 kls Exp $ * $Id: skins.c 4.1 2018/04/28 12:13:01 kls Exp $
*/ */
#include "skins.h" #include "skins.h"
@ -352,6 +352,14 @@ void cSkins::ProcessQueuedMessages(void)
dsyslog("cSkins::ProcessQueuedMessages() called from background thread - ignored!"); dsyslog("cSkins::ProcessQueuedMessages() called from background thread - ignored!");
return; return;
} }
// Check whether there is a cSkinDisplay object (if any) that implements SetMessage():
if (cSkinDisplay *sd = cSkinDisplay::Current()) {
if (!(dynamic_cast<cSkinDisplayChannel *>(sd) ||
dynamic_cast<cSkinDisplayMenu *>(sd) ||
dynamic_cast<cSkinDisplayReplay *>(sd) ||
dynamic_cast<cSkinDisplayMessage *>(sd)))
return;
}
cSkinQueuedMessage *msg = NULL; cSkinQueuedMessage *msg = NULL;
// Get the first waiting message: // Get the first waiting message:
queueMessageMutex.Lock(); queueMessageMutex.Lock();

5
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.tvdr.de * The project's page is at http://www.tvdr.de
* *
* $Id: vdr.c 4.25 2018/04/10 13:24:43 kls Exp $ * $Id: vdr.c 4.26 2018/04/28 11:27:48 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -1176,8 +1176,7 @@ int main(int argc, char *argv[])
if (!Menu && !cOsd::IsOpen()) if (!Menu && !cOsd::IsOpen())
Menu = CamControl(); Menu = CamControl();
// Queued messages: // Queued messages:
if (!Skins.IsOpen()) Skins.ProcessQueuedMessages();
Skins.ProcessQueuedMessages();
// User Input: // User Input:
cOsdObject *Interact = Menu ? Menu : cControl::Control(); cOsdObject *Interact = Menu ? Menu : cControl::Control();
eKeys key = Interface->GetKey(!Interact || !Interact->NeedsFastResponse()); eKeys key = Interface->GetKey(!Interact || !Interact->NeedsFastResponse());