diff options
author | Petter Reinholdtsen <pere@hungry.com> | 2009-10-21 15:10:32 +0000 |
---|---|---|
committer | Petter Reinholdtsen <pere@hungry.com> | 2009-10-21 15:10:32 +0000 |
commit | 96a8bbffba10352e9e26919c378a63ae91590dd7 (patch) | |
tree | 81412f51c6bdc99e94e3ef8e722b9870a62720ac | |
parent | a768bd03ff3b693091632d717bd6cf46eb466322 (diff) |
Improve handling of loop/repeat. Remove temporary files when they are
no longer needed.
-rwxr-xr-x | frikanalen/bin/scheduler | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/frikanalen/bin/scheduler b/frikanalen/bin/scheduler index af77224..a20b51f 100755 --- a/frikanalen/bin/scheduler +++ b/frikanalen/bin/scheduler @@ -123,7 +123,7 @@ while ($seq < scalar @events) { $seq++; } -print Dumper(Event::all_watchers()); +#print Dumper(Event::all_watchers()); Event::loop(); @@ -232,9 +232,12 @@ sub generate_program { system("image2raw -r $len test.png > test.dv"); # Generate Ogg Theora, VLC do not understand raw DV - system("ffmpeg2theora --width 384 --height 288 -o test.ogv test.dv"); + my $resultfile = "test.ogv"; + system("ffmpeg2theora --width 384 --height 288 -o $resultfile test.dv"); + unlink "test.png"; + unlink "test.dv"; print "Done generating pause screen DV\n"; - return "test.ogv"; + return $resultfile; } else { print "Unable to save test.png\n"; } @@ -312,10 +315,19 @@ sub vlc_play { unless (lwp_get($url)) { print "Failed to contact VLC\n"; } - if ($loop) { + if ($loop && !$vlc->{loop}) { my $url = $vlc->{url} . "requests/status.xml?command=pl_repeat"; + $vlc->{loop} = 1; unless (lwp_get($url)) { print "Failed to contact VLC\n"; } + + } else { + my $url = $vlc->{url} . "requests/status.xml?command=pl_repeat"; + $vlc->{loop} = 0; + unless (lwp_get($url)) { + print "Failed to contact VLC\n"; + } + } } |