diff options
Diffstat (limited to 'pages/multischedule.ecpp')
-rw-r--r-- | pages/multischedule.ecpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/pages/multischedule.ecpp b/pages/multischedule.ecpp index 22a3f07..e82942b 100644 --- a/pages/multischedule.ecpp +++ b/pages/multischedule.ecpp @@ -46,9 +46,7 @@ std::vector<time_t> times_start; if (!logged_in && LiveSetup().UseAuth()) return reply.redirect("login.html"); pageTitle = tr("MultiSchedule"); -#if VDRVERSNUM >= 20301 - LOCK_CHANNELS_READ; -#else +#if VDRVERSNUM < 20301 ReadLock channelsLock( Channels ); if ( !channelsLock ) throw HtmlError( tr("Couldn't aquire access to channels, please try again later.") ); @@ -62,6 +60,9 @@ std::vector<time_t> times_start; if ( ( channel_groups_setting.compare(LiveSetup().GetChannelGroups()) != 0 ) || ( channel_groups_numbers.size() == 0 ) ) { +#if VDRVERSNUM >= 20301 + LOCK_CHANNELS_READ; +#endif // build the groups of channels to display std::string channelGroups=LiveSetup().GetChannelGroups(); if ( channelGroups.empty() ) @@ -271,9 +272,7 @@ std::vector<time_t> times_start; <& menu active=("multischedule") component=("multischedule.channel_selection") &> <div class="inhalt"> <%cpp> -#if VDRVERSNUM >= 20301 - LOCK_SCHEDULES_READ; -#else +#if VDRVERSNUM < 20301 cSchedulesLock schedulesLock; cSchedules const* schedules = cSchedules::Schedules( schedulesLock ); #endif @@ -305,14 +304,16 @@ std::vector<time_t> times_start; for ( unsigned int j = 0; j<channel_groups_numbers[ channel ].size(); j++) { int prev_row = -1; - - int chan = channel_groups_numbers[ channel ][ j ]; + cChannel* Channel; #if VDRVERSNUM >= 20301 - cChannel* Channel = (cChannel *)Channels->GetByNumber( chan ); + { + LOCK_CHANNELS_READ; + Channel = (cChannel *)Channels->GetByNumber( chan ); + } #else - cChannel* Channel = Channels.GetByNumber( chan ); + Channel = Channels.GetByNumber( chan ); #endif if ( ! Channel ) continue; @@ -321,10 +322,14 @@ std::vector<time_t> times_start; channel_names[ j ] = Channel->Name(); channel_IDs[ j ] = Channel->GetChannelID(); + cSchedule const* Schedule; #if VDRVERSNUM >= 20301 - cSchedule const* Schedule = Schedules->GetSchedule( (cChannel *)Channel ); + { + LOCK_SCHEDULES_READ; + Schedule = Schedules->GetSchedule( Channel ); + } #else - cSchedule const* Schedule = schedules->GetSchedule( Channel ); + Schedule = schedules->GetSchedule( Channel ); #endif if ( ! Schedule ) continue; |