From de5327a048497cc63e7dcac5c0f9110c435348b6 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 10 Jan 2025 13:12:04 +0100 Subject: [PATCH] Fixed a possible deadlock when canceling an editing process --- HISTORY | 3 ++- cutter.c | 9 ++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index 46fb9308..26798382 100644 --- a/HISTORY +++ b/HISTORY @@ -10034,7 +10034,7 @@ Video Disk Recorder Revision History (suggested by Stefan Hofmann). - Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann). -2025-01-07: +2025-01-10: - Removed all DEPRECATED_* code. - Fixed error checking in case the fps value can't be determined by the frame parser. @@ -10047,3 +10047,4 @@ Video Disk Recorder Revision History - Fixed handling the fps value if it can't be determined from the video data. - Fixed accessing a timer's event schedule in case the event has been removed from the schedule. +- Fixed a possible deadlock when canceling an editing process. diff --git a/cutter.c b/cutter.c index 0932b3b5..bfe4f3de 100644 --- a/cutter.c +++ b/cutter.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: cutter.c 5.3 2024/09/20 21:34:18 kls Exp $ + * $Id: cutter.c 5.4 2025/01/10 13:12:04 kls Exp $ */ #include "cutter.h" @@ -623,8 +623,11 @@ void cCuttingThread::HandleErrors(bool Force) Force = true; } if (Force) { - LOCK_RECORDINGS_WRITE; - Recordings->UpdateByName(editedRecordingName); + cStateKey StateKey; + if (cRecordings *Recordings = cRecordings::GetRecordingsWrite(StateKey, 1)) { + Recordings->UpdateByName(editedRecordingName); + StateKey.Remove(); + } } lastErrorHandling = time(NULL); }