summaryrefslogtreecommitdiff
path: root/tasks.cpp
diff options
context:
space:
mode:
authorRolf Ahrenberg <Rolf.Ahrenberg@sci.fi>2017-04-01 23:17:15 +0300
committerRolf Ahrenberg <Rolf.Ahrenberg@sci.fi>2017-04-01 23:17:15 +0300
commiteaa015874e3e494006d67260feaebe6377568ebb (patch)
tree9d407c10cbf0d541377a08e390ed603909abfddb /tasks.cpp
parenta8eb15416c38009efb9562c5d64ef87719ae017c (diff)
downloadvdr-plugin-live-eaa015874e3e494006d67260feaebe6377568ebb.tar.gz
vdr-plugin-live-eaa015874e3e494006d67260feaebe6377568ebb.tar.bz2
VDR-2.3.1 compatibility patch by Nachteule.
http://www.vdr-portal.de/board16-video-disk-recorder/board55-vdr-plugins/p1280013-vdr-live-vdr-2-3-1/#post1280013
Diffstat (limited to 'tasks.cpp')
-rw-r--r--tasks.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tasks.cpp b/tasks.cpp
index 5f73ba6..c381382 100644
--- a/tasks.cpp
+++ b/tasks.cpp
@@ -34,14 +34,23 @@ StickyTask::~StickyTask()
void SwitchChannelTask::Action()
{
+#if VDRVERSNUM >= 20301
+ LOCK_CHANNELS_READ;
+ cChannel* channel = (cChannel *)Channels->GetByChannelID( m_channel );
+#else
ReadLock lock( Channels );
cChannel* channel = Channels.GetByChannelID( m_channel );
+#endif
if ( channel == 0 ) {
SetError( tr("Couldn't find channel or no channels available.") );
return;
}
+#if VDRVERSNUM >= 20301
+ if ( !Channels->SwitchTo( channel->Number() ) )
+#else
if ( !Channels.SwitchTo( channel->Number() ) )
+#endif
SetError( tr("Couldn't switch to channel.") );
}