Fixed an 'invalid lock sequence' when deleting the timeshift timer

This commit is contained in:
Klaus Schmidinger
2025-07-22 21:10:00 +02:00
parent 07adff7b02
commit f1b52167c0
4 changed files with 26 additions and 15 deletions

View File

@@ -10138,7 +10138,7 @@ Video Disk Recorder Revision History
- Fixed an invalid lock sequence when pressing the Channel+/Channel- keys while in the
"What's on..." menu in live view.
2025-07-21:
2025-07-22:
- Fixed cPoller::Poll() to allow negative timeout values again.
- When regenerating the index of a recording, PID changes are now taken into account
@@ -10173,3 +10173,4 @@ Video Disk Recorder Revision History
- If an SVDRP peer connection is lost, the connection in the opposite direction is now also
closed (reported by Markus Ehrnsperger).
- Shutdown now takes into account the VPS margin (reported by Christoph Haubrich).
- Fixed an 'invalid lock sequence' when deleting the timeshift timer.

28
menu.c
View File

@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 5.31 2025/07/06 15:06:55 kls Exp $
* $Id: menu.c 5.32 2025/07/22 21:10:00 kls Exp $
*/
#include "menu.h"
@@ -5725,6 +5725,7 @@ int cAdaptiveSkipper::GetValue(eKeys Key)
// --- cReplayControl --------------------------------------------------------
cTimer *cReplayControl::timeshiftTimer = NULL;
cReplayControl *cReplayControl::currentReplayControl = NULL;
cString cReplayControl::fileName;
@@ -5760,6 +5761,18 @@ cReplayControl::~cReplayControl()
currentReplayControl = NULL;
}
void cReplayControl::DelTimeshiftTimer(void)
{
if (timeshiftTimer) {
LOCK_TIMERS_WRITE;
Timers->SetExplicitModify();
Timers->Del(timeshiftTimer);
Timers->SetModified();
isyslog("deleted timer %s", *timeshiftTimer->ToDescr());
timeshiftTimer = NULL;
}
}
void cReplayControl::Stop(void)
{
Hide();
@@ -5769,17 +5782,10 @@ void cReplayControl::Stop(void)
if (rc && rc->InstantId()) {
if (Active()) {
if (Setup.DelTimeshiftRec == 2 || Interface->Confirm(tr("Delete timeshift recording?"))) {
{
LOCK_TIMERS_WRITE;
Timers->SetExplicitModify();
cTimer *Timer = rc->Timer();
// At this point somewhere up the call stack there may be a lock on the Channels, so we can't
// lock the Timers here and have to delete this timer later:
timeshiftTimer = rc->Timer();
rc->Stop(false); // don't execute user command
if (Timer) {
Timers->Del(Timer);
Timers->SetModified();
isyslog("deleted timer %s", *Timer->ToDescr());
}
}
cDvbPlayerControl::Stop();
bool Error = false;
{

4
menu.h
View File

@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.h 5.6 2025/03/02 11:03:35 kls Exp $
* $Id: menu.h 5.7 2025/07/22 21:10:00 kls Exp $
*/
#ifndef __MENU_H
@@ -292,6 +292,7 @@ public:
class cReplayControl : public cDvbPlayerControl {
private:
static cTimer *timeshiftTimer;
cSkinDisplayReplay *displayReplay;
cAdaptiveSkipper adaptiveSkipper;
cMarks marks;
@@ -322,6 +323,7 @@ private:
public:
cReplayControl(bool PauseLive = false);
virtual ~cReplayControl() override;
static void DelTimeshiftTimer(void);
void Stop(void);
virtual cOsdObject *GetInfo(void) override;
virtual const cRecording *GetRecording(void) override;

4
vdr.c
View File

@@ -22,7 +22,7 @@
*
* The project's page is at https://www.tvdr.de
*
* $Id: vdr.c 5.20 2025/07/06 15:06:55 kls Exp $
* $Id: vdr.c 5.21 2025/07/22 21:10:00 kls Exp $
*/
#include <getopt.h>
@@ -1594,6 +1594,8 @@ int main(int argc, char *argv[])
}
}
cReplayControl::DelTimeshiftTimer();
ReportEpgBugFixStats();
// Main thread hooks of plugins: