summaryrefslogtreecommitdiff
path: root/tvguideosd.c
diff options
context:
space:
mode:
authorkamel5 <kamel5 (at) gmx (dot) net>2018-03-08 14:24:25 +0100
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-01-27 11:32:20 +0100
commit2ed3344bb9a12ad9d6fb9c4a93603e300678a0a2 (patch)
treef09c81e5feea3445944bc19d1695952c78e74649 /tvguideosd.c
parent82fb45a0884dedc205e9cb80766cbf213276e06f (diff)
downloadvdr-plugin-tvguide-2ed3344bb9a12ad9d6fb9c4a93603e300678a0a2.tar.gz
vdr-plugin-tvguide-2ed3344bb9a12ad9d6fb9c4a93603e300678a0a2.tar.bz2
Some changes for LOCKING
Diffstat (limited to 'tvguideosd.c')
-rw-r--r--tvguideosd.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/tvguideosd.c b/tvguideosd.c
index 71491a7..e5afc0e 100644
--- a/tvguideosd.c
+++ b/tvguideosd.c
@@ -73,15 +73,17 @@ void cTvGuideOsd::Show(void) {
void cTvGuideOsd::drawOsd() {
cPixmap::Lock();
+ int numBack = tvguideConfig.numGrids / 2;
+ int offset = 0;
+ const cChannel *newStartChannel;
#if VDRVERSNUM >= 20301
+ {
LOCK_CHANNELS_READ;
const cChannel *startChannel = Channels->GetByNumber(cDevice::CurrentChannel());
#else
cChannel *startChannel = Channels.GetByNumber(cDevice::CurrentChannel());
#endif
- int numBack = tvguideConfig.numGrids / 2;
- int offset = 0;
- const cChannel *newStartChannel = startChannel;
+ newStartChannel = startChannel;
#if VDRVERSNUM >= 20301
for (; newStartChannel ; newStartChannel = Channels->Prev(newStartChannel)) {
#else
@@ -96,6 +98,7 @@ void cTvGuideOsd::drawOsd() {
if (!newStartChannel)
#if VDRVERSNUM >= 20301
newStartChannel = Channels->First();
+ } //LOCK_CHANNELS_READ
#else
newStartChannel = Channels.First();
#endif
@@ -236,6 +239,7 @@ void cTvGuideOsd::channelForward() {
if (!colRight) {
const cChannel *channelRight = activeGrid->column->getChannel();
#if VDRVERSNUM >= 20301
+ {
LOCK_CHANNELS_READ;
while (channelRight = Channels->Next(channelRight)) {
#else
@@ -254,6 +258,9 @@ void cTvGuideOsd::channelForward() {
}
}
}
+#if VDRVERSNUM >= 20301
+ } //LOCK_CHANNELS_READ
+#endif
if (colRight) {
colAdded = true;
if (columns.Count() == tvguideConfig.numGrids) {
@@ -291,8 +298,9 @@ void cTvGuideOsd::channelBack() {
if (!colLeft) {
const cChannel *channelLeft = activeGrid->column->getChannel();
#if VDRVERSNUM >= 20301
- LOCK_CHANNELS_READ;
- while (channelLeft = Channels->Prev(channelLeft)) {
+ {
+ LOCK_CHANNELS_READ;
+ while (channelLeft = Channels->Prev(channelLeft)) {
#else
while (channelLeft = Channels.Prev(channelLeft)) {
#endif
@@ -306,6 +314,9 @@ void cTvGuideOsd::channelBack() {
}
}
}
+#if VDRVERSNUM >= 20301
+ } //LOCK_CHANNELS_READ
+#endif
if (colLeft) {
colAdded = true;
if (columns.Count() == tvguideConfig.numGrids) {
@@ -677,11 +688,14 @@ void cTvGuideOsd::CheckTimeout(void) {
int newChannelNum = channelJumper->GetChannel();
delete channelJumper;
channelJumper = NULL;
+ const cChannel *newChannel;
#if VDRVERSNUM >= 20301
+ {
LOCK_CHANNELS_READ;
- const cChannel *newChannel = Channels->GetByNumber(newChannelNum);
+ newChannel = Channels->GetByNumber(newChannelNum);
+ }
#else
- const cChannel *newChannel = Channels.GetByNumber(newChannelNum);
+ newChannel = Channels.GetByNumber(newChannelNum);
#endif
if (newChannel) {
readChannels(newChannel);
@@ -767,7 +781,7 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
void cTvGuideOsd::dump() {
esyslog("tvguide: ------Dumping Content---------");
activeGrid->debug();
- int i=1;
+// int i=1;
for (cChannelColumn *col = columns.First(); col; col = columns.Next(col)) {
col->dumpGrids();
}