From fc553499d07c439fbe7299fbc3a8e1a2f72ca32b Mon Sep 17 00:00:00 2001 From: Jon duSaint Date: Sat, 16 Sep 2023 09:26:23 -0700 Subject: reolink: Minor fixes * Pass along camera quality kludge flag to Snap. * Print an error when waitpid finds a child not in the list * More directly search for today's video --- reolink/reolink | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'reolink') diff --git a/reolink/reolink b/reolink/reolink index b2ac31f..7b5ec2c 100755 --- a/reolink/reolink +++ b/reolink/reolink @@ -269,7 +269,7 @@ sub snapshot { my @cameras = @_ ? @_ : keys (%cameras); foreach my $camera (@cameras) { - my $r = Reolink->new (host => host ($camera)); + my $r = Reolink->new (host => host ($camera), %{ $cameras{$camera}->{args} }); $r->Login || die "Failed to login to $camera\n"; $r->Errors (1); @@ -349,6 +349,8 @@ sub process_complete { if (@sigchld_handlers) { $SIG{CHLD} = pop @sigchld_handlers; } + } else { + error ("SIGCHLD for pid $pid ($?), but it's not in the list!"); } } } @@ -388,14 +390,12 @@ sub maybe_generate_video { my $video_prefix = $date // sprintf ('%04d%02d%02d', $t[5]+1900, $t[4]+1, $t[3]); - my @videos; foreach my $ext (@video_extensions) { - push @videos, ; - } - - if (@videos) { - debug ("already generated for $camera $video_prefix"); - next; + my $out = File::Spec->catfile (spool ($camera), "$video_prefix.$ext"); + if (-f $out && -s $out) { + debug ("already generated for $camera $out"); + next CAMERA; + } } message ("generating video for $camera $video_prefix"); -- cgit v1.2.3