diff options
| author | Jon duSaint | 2023-09-16 09:26:23 -0700 |
|---|---|---|
| committer | Jon duSaint | 2023-09-16 09:26:23 -0700 |
| commit | fc553499d07c439fbe7299fbc3a8e1a2f72ca32b (patch) | |
| tree | 7a942ba9f6ab7cc3adb6a0ee968c970c6babb46a | |
| parent | 5f3dc020f0164ef0ae833b07463a40c9c44ae0b6 (diff) | |
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
| -rwxr-xr-x | reolink/reolink | 16 |
1 files changed, 8 insertions, 8 deletions
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, <spool($camera)/$video_prefix*.$ext>; - } - - 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"); |
