mirror of
https://github.com/vdr-projects/vdr.git
synced 2025-03-01 10:50:46 +00:00
Revised locking in cMenuSchedule and cMenuWhatsOn
This commit is contained in:
parent
988d5aebfa
commit
45091fbd72
1
HISTORY
1
HISTORY
@ -10088,3 +10088,4 @@ Video Disk Recorder Revision History
|
|||||||
- 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.
|
- Added missing locks to SetMenuItem() functions.
|
||||||
|
- Revised locking in cMenuSchedule and cMenuWhatsOn.
|
||||||
|
30
menu.c
30
menu.c
@ -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.22 2025/02/20 10:23:15 kls Exp $
|
* $Id: menu.c 5.23 2025/02/25 15:53:43 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "menu.h"
|
#include "menu.h"
|
||||||
@ -1521,6 +1521,7 @@ cMenuEvent::cMenuEvent(const cTimers *Timers, const cChannels *Channels, const c
|
|||||||
|
|
||||||
void cMenuEvent::Display(void)
|
void cMenuEvent::Display(void)
|
||||||
{
|
{
|
||||||
|
LOCK_SCHEDULES_READ;
|
||||||
cOsdMenu::Display();
|
cOsdMenu::Display();
|
||||||
DisplayMenu()->SetEvent(event);
|
DisplayMenu()->SetEvent(event);
|
||||||
if (event->Description())
|
if (event->Description())
|
||||||
@ -1607,6 +1608,7 @@ static const char *TimerMatchChars = " tT iI";
|
|||||||
|
|
||||||
bool cMenuScheduleItem::Update(const cTimers *Timers, bool Force)
|
bool cMenuScheduleItem::Update(const cTimers *Timers, bool Force)
|
||||||
{
|
{
|
||||||
|
LOCK_CHANNELS_READ;
|
||||||
LOCK_SCHEDULES_READ;
|
LOCK_SCHEDULES_READ;
|
||||||
eTimerMatch OldTimerMatch = timerMatch;
|
eTimerMatch OldTimerMatch = timerMatch;
|
||||||
bool OldTimerActive = timerActive;
|
bool OldTimerActive = timerActive;
|
||||||
@ -1682,7 +1684,6 @@ cMenuWhatsOn::cMenuWhatsOn(const cTimers *Timers, const cChannels *Channels, con
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
currentChannel = CurrentChannelNr;
|
currentChannel = CurrentChannelNr;
|
||||||
Display();
|
|
||||||
SetHelpKeys(Channels);
|
SetHelpKeys(Channels);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1783,10 +1784,8 @@ eOSState cMenuWhatsOn::Record(void)
|
|||||||
if (HasSubMenu())
|
if (HasSubMenu())
|
||||||
CloseSubMenu();
|
CloseSubMenu();
|
||||||
}
|
}
|
||||||
if (Update()) {
|
if (Update())
|
||||||
LOCK_SCHEDULES_READ;
|
|
||||||
Display();
|
Display();
|
||||||
}
|
|
||||||
LOCK_CHANNELS_READ;
|
LOCK_CHANNELS_READ;
|
||||||
SetHelpKeys(Channels);
|
SetHelpKeys(Channels);
|
||||||
return osContinue;
|
return osContinue;
|
||||||
@ -1806,6 +1805,7 @@ eOSState cMenuWhatsOn::ProcessKey(eKeys Key)
|
|||||||
case kGreen: {
|
case kGreen: {
|
||||||
cMenuScheduleItem *mi = (cMenuScheduleItem *)Get(Current());
|
cMenuScheduleItem *mi = (cMenuScheduleItem *)Get(Current());
|
||||||
if (mi) {
|
if (mi) {
|
||||||
|
LOCK_CHANNELS_READ;
|
||||||
scheduleEvent = mi->event;
|
scheduleEvent = mi->event;
|
||||||
currentChannel = mi->channel->Number();
|
currentChannel = mi->channel->Number();
|
||||||
}
|
}
|
||||||
@ -1818,14 +1818,12 @@ eOSState cMenuWhatsOn::ProcessKey(eKeys Key)
|
|||||||
case kChanUp:
|
case kChanUp:
|
||||||
case kChanDn|k_Repeat:
|
case kChanDn|k_Repeat:
|
||||||
case kChanDn: if (!HasSubMenu()) {
|
case kChanDn: if (!HasSubMenu()) {
|
||||||
|
LOCK_CHANNELS_READ;
|
||||||
for (cOsdItem *item = First(); item; item = Next(item)) {
|
for (cOsdItem *item = First(); item; item = Next(item)) {
|
||||||
if (((cMenuScheduleItem *)item)->channel->Number() == cDevice::CurrentChannel()) {
|
if (((cMenuScheduleItem *)item)->channel->Number() == cDevice::CurrentChannel()) {
|
||||||
|
DisplayCurrent(false);
|
||||||
SetCurrent(item);
|
SetCurrent(item);
|
||||||
{
|
DisplayCurrent(true);
|
||||||
LOCK_SCHEDULES_READ;
|
|
||||||
Display();
|
|
||||||
}
|
|
||||||
LOCK_CHANNELS_READ;
|
|
||||||
SetHelpKeys(Channels);
|
SetHelpKeys(Channels);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1843,10 +1841,8 @@ eOSState cMenuWhatsOn::ProcessKey(eKeys Key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!HasSubMenu()) {
|
else if (!HasSubMenu()) {
|
||||||
if (HadSubMenu && Update()) {
|
if (HadSubMenu && Update())
|
||||||
LOCK_SCHEDULES_READ;
|
|
||||||
Display();
|
Display();
|
||||||
}
|
|
||||||
if (Key != kNone) {
|
if (Key != kNone) {
|
||||||
LOCK_CHANNELS_READ;
|
LOCK_CHANNELS_READ;
|
||||||
SetHelpKeys(Channels);
|
SetHelpKeys(Channels);
|
||||||
@ -2094,10 +2090,8 @@ eOSState cMenuSchedule::Record(void)
|
|||||||
if (HasSubMenu())
|
if (HasSubMenu())
|
||||||
CloseSubMenu();
|
CloseSubMenu();
|
||||||
}
|
}
|
||||||
if (Update()) {
|
if (Update())
|
||||||
LOCK_SCHEDULES_READ;
|
|
||||||
Display();
|
Display();
|
||||||
}
|
|
||||||
SetHelpKeys();
|
SetHelpKeys();
|
||||||
return osContinue;
|
return osContinue;
|
||||||
}
|
}
|
||||||
@ -2191,10 +2185,8 @@ eOSState cMenuSchedule::ProcessKey(eKeys Key)
|
|||||||
Set(Timers, Channels, Channel, true);
|
Set(Timers, Channels, Channel, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (HadSubMenu && Update()) {
|
else if (HadSubMenu && Update())
|
||||||
LOCK_SCHEDULES_READ;
|
|
||||||
Display();
|
Display();
|
||||||
}
|
|
||||||
if (Key != kNone)
|
if (Key != kNone)
|
||||||
SetHelpKeys();
|
SetHelpKeys();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user