Added missing locks to SetMenuItem() functions

This commit is contained in:
Klaus Schmidinger 2025-02-20 10:23:15 +01:00
parent 8c3671fae6
commit 988d5aebfa
2 changed files with 8 additions and 2 deletions

View File

@ -10034,7 +10034,7 @@ Video Disk Recorder Revision History
(suggested by Stefan Hofmann). (suggested by Stefan Hofmann).
- Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann). - Added vdrrootdir and incdir to vdr.pc (thanks to Stefan Hofmann).
2025-02-19: 2025-02-20:
- Removed all DEPRECATED_* code. - Removed all DEPRECATED_* code.
- Fixed error checking in case the fps value can't be determined by the frame parser. - Fixed error checking in case the fps value can't be determined by the frame parser.
@ -10087,3 +10087,4 @@ Video Disk Recorder Revision History
Baierl). Baierl).
- Fixed spurious fast frames when switching from "slow back" to "slow forward". - Fixed spurious fast frames when switching from "slow back" to "slow forward".
- Fixed cPtsIndex::FindFrameNumber() to handle the case where Pts points to an I-frame. - Fixed cPtsIndex::FindFrameNumber() to handle the case where Pts points to an I-frame.
- Added missing locks to SetMenuItem() functions.

7
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 5.21 2025/02/17 10:49:10 kls Exp $ * $Id: menu.c 5.22 2025/02/20 10:23:15 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -342,6 +342,7 @@ void cMenuChannelItem::Set(void)
void cMenuChannelItem::SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable) void cMenuChannelItem::SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable)
{ {
LOCK_CHANNELS_READ;
if (!DisplayMenu->SetItemChannel(channel, Index, Current, Selectable, sortMode == csmProvider)) if (!DisplayMenu->SetItemChannel(channel, Index, Current, Selectable, sortMode == csmProvider))
DisplayMenu->SetItem(Text(), Index, Current, Selectable); DisplayMenu->SetItem(Text(), Index, Current, Selectable);
} }
@ -1293,6 +1294,7 @@ void cMenuTimerItem::Set(void)
void cMenuTimerItem::SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable) void cMenuTimerItem::SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable)
{ {
LOCK_TIMERS_READ;
if (!DisplayMenu->SetItemTimer(timer, Index, Current, Selectable)) if (!DisplayMenu->SetItemTimer(timer, Index, Current, Selectable))
DisplayMenu->SetItem(Text(), Index, Current, Selectable); DisplayMenu->SetItem(Text(), Index, Current, Selectable);
} }
@ -1633,6 +1635,8 @@ bool cMenuScheduleItem::Update(const cTimers *Timers, bool Force)
void cMenuScheduleItem::SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable) void cMenuScheduleItem::SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable)
{ {
LOCK_CHANNELS_READ;
LOCK_SCHEDULES_READ;
if (!DisplayMenu->SetItemEvent(event, Index, Current, Selectable, channel, withDate, timerMatch, timerActive)) if (!DisplayMenu->SetItemEvent(event, Index, Current, Selectable, channel, withDate, timerMatch, timerActive))
DisplayMenu->SetItem(Text(), Index, Current, Selectable); DisplayMenu->SetItem(Text(), Index, Current, Selectable);
} }
@ -3049,6 +3053,7 @@ void cMenuRecordingItem::IncrementCounter(bool New)
void cMenuRecordingItem::SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable) void cMenuRecordingItem::SetMenuItem(cSkinDisplayMenu *DisplayMenu, int Index, bool Current, bool Selectable)
{ {
LOCK_RECORDINGS_READ;
if (!DisplayMenu->SetItemRecording(recording, Index, Current, Selectable, level, totalEntries, newEntries)) if (!DisplayMenu->SetItemRecording(recording, Index, Current, Selectable, level, totalEntries, newEntries))
DisplayMenu->SetItem(Text(), Index, Current, Selectable); DisplayMenu->SetItem(Text(), Index, Current, Selectable);
} }