diff options
author | Lars Hanisch <dvb@flensrocker.de> | 2015-10-30 00:43:25 +0100 |
---|---|---|
committer | Lars Hanisch <dvb@flensrocker.de> | 2015-10-30 00:43:25 +0100 |
commit | 80817116bafde29df370b519b3485c416c37564e (patch) | |
tree | 45c7d6d1efa6109591f6b943f810b9b6e19b6c4c /status.c | |
parent | db07e2d8b8b36fccd88d5170886d7cbe54239326 (diff) | |
download | vdr-plugin-dynamite-master.tar.gz vdr-plugin-dynamite-master.tar.bz2 |
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 24 |
1 files changed, 21 insertions, 3 deletions
@@ -44,13 +44,25 @@ void cDynamiteStatus::Init(void) if (isnumber(cid)) // for compatibility with old setup.conf files startupChannel = atoi(cid); else { - if (cChannel *Channel = Channels.GetByChannelID(tChannelID::FromString(cid))) { +#if VDRVERSNUM > 20300 + LOCK_CHANNELS_READ; + const cChannels *vdrchannels = Channels; +#else + cChannels *vdrchannels = &Channels; +#endif + if (const cChannel *Channel = vdrchannels->GetByChannelID(tChannelID::FromString(cid))) { status = new cDynamiteStatus(Channel->Number()); return; } } } - if (cChannel *Channel = Channels.GetByNumber(startupChannel)) +#if VDRVERSNUM > 20300 + LOCK_CHANNELS_READ; + const cChannels *vdrchannels = Channels; +#else + cChannels *vdrchannels = &Channels; +#endif + if (const cChannel *Channel = vdrchannels->GetByNumber(startupChannel)) status = new cDynamiteStatus(Channel->Number()); } @@ -71,6 +83,12 @@ void cDynamiteStatus::SetStartupChannel(void) return; } isyslog("dynamite: new device attached, retry switching to startup channel %d", status->startupChannel); - if (!Channels.SwitchTo(status->startupChannel)) +#if VDRVERSNUM > 20300 + LOCK_CHANNELS_READ; + const cChannels *vdrchannels = Channels; +#else + cChannels *vdrchannels = &Channels; +#endif + if (!vdrchannels->SwitchTo(status->startupChannel)) status->switchCount--; } |