summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Reinholdtsen <pere@hungry.com>2010-01-09 15:22:29 +0000
committerPetter Reinholdtsen <pere@hungry.com>2010-01-09 15:22:29 +0000
commit52204c02cbbd4e7069e4fb13706c3e17882ecb6c (patch)
tree1137331e1c395f997be6970595ab28851201a0fc
parent9e48bb7476f518b67d17eabd50576c460744813f (diff)
Report error if the pause screen start too late.
-rwxr-xr-xfrikanalen/bin/scheduler9
1 files changed, 6 insertions, 3 deletions
diff --git a/frikanalen/bin/scheduler b/frikanalen/bin/scheduler
index bfe53de..8fbd43f 100755
--- a/frikanalen/bin/scheduler
+++ b/frikanalen/bin/scheduler
@@ -130,11 +130,11 @@ while ($seq < scalar @events) {
# Skip entries from the past
if ($starttime >= $now) {
- schedule_video($vlc, $seq, $starttime, $stoptime);
+ schedule_video($vlc, $seq, int($starttime), int($stoptime));
} elsif ($stoptime >= $now && $starttime <= $now) {
# If some program is already running, just start it to get
# something showing.
- schedule_video($vlc, $seq, $now, $stoptime);
+ schedule_video($vlc, $seq, $now, int($stoptime));
}
$seq++;
}
@@ -207,10 +207,13 @@ sub schedule_video {
if (30 < $duration);
Event->timer(at => $stoptime,
cb => sub {
- my $nowstring = strftime("%H:%M:%S", localtime(time()));
+ my $now = time();
+ my $nowstring = strftime("%H:%M:%S", localtime($now));
my $str = strftime("%H:%M:%S", localtime($stoptime));
print "Starting pause screen $str (now $nowstring)\n";
vlc_play($vlc, $programogv, 1);
+ print "error: Started pause screen too late ($stoptime != $now)\n"
+ unless ($stoptime == $now);
});
} );
}