script/playback_machine.pl untested

filter: Statementstmt 0.0% 0 / 33 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 6 Podpod n/a totaltotal 0.0% 0 / 46 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 #!/usr/local/bin/perl
2  
3 use strict;
4 use warnings;
5  
6 our $VERSION = '0.09'; # VERSION
7  
8 use Getopt::Long;
9  
10 use Log::Log4perl;
11  
12 use Video::PlaybackMachine::Config;
13  
14 use Video::PlaybackMachine;
15  
16 our $config = Video::PlaybackMachine::Config->config();
17  
18 MAIN: {
19  
20 if ( $config->daemonize() ) {
21 my $start_time = time();
22  
23 while (1) {
24  
25 # Spawn off a child to do actual running
26 my $pid;
27 if ( my $pid = fork ) {
28 sleep 5;
29 wait;
30 }
31 else {
32  
33 open( STDERR, '>>' . $config->stderr_log() )
34 or die "Couldn't open '"
35 . $config->stderr_log()
36 . "' for STDERR log: $!; stopped";
37  
38 Log::Log4perl::init( \( $config->log_config() ) );
39  
40 Video::PlaybackMachine->run($start_time);
41 }
42  
43 }
44  
45 }
46 else {
47 Video::PlaybackMachine->run(undef, 1);
48 }
49  
50 }
51