cleanup, reset result

This commit is contained in:
Isaac Connor 2018-02-02 16:07:13 -05:00
parent 058b2be9a7
commit e25af4b40c
5 changed files with 14 additions and 13 deletions

View File

@ -172,7 +172,7 @@ while( 1 ) {
if ( $restart ) {
Info( "Restarting analysis daemon for $$monitor{Id} $$monitor{Name}\n");
my $command = "zmdc.pl restart zma -m ".$monitor->{Id};
my $command = 'zmdc.pl restart zma -m '.$monitor->{Id};
runCommand( $command );
} # end if restart
} # end if check analysis daemon

View File

@ -108,7 +108,6 @@ FfmpegCamera::FfmpegCamera( int p_id, const std::string &p_path, const std::stri
mFrame = NULL;
frameCount = 0;
startTime = 0;
mIsOpening = false;
mCanCapture = false;
mOpenStart = 0;
videoStore = NULL;
@ -162,6 +161,7 @@ void FfmpegCamera::Terminate() {
int FfmpegCamera::PrimeCapture() {
if ( mCanCapture ) {
Info( "Priming capture from %s", mPath.c_str() );
CloseFfmpeg();
}
mVideoStreamId = -1;
@ -322,7 +322,6 @@ int FfmpegCamera::OpenFfmpeg() {
int ret;
mOpenStart = time(NULL);
mIsOpening = true;
have_video_keyframe = false;
// Open the input, not necessarily a file
@ -364,7 +363,6 @@ int FfmpegCamera::OpenFfmpeg() {
if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, &opts ) != 0 )
#endif
{
mIsOpening = false;
Error("Unable to open input %s due to: %s", mPath.c_str(), strerror(errno));
return -1;
}
@ -373,8 +371,7 @@ int FfmpegCamera::OpenFfmpeg() {
Warning( "Option %s not recognized by ffmpeg", e->key);
}
mIsOpening = false;
Debug ( 1, "Opened input" );
Debug(1, "Opened input");
Info( "Stream open %s, parsing streams...", mPath.c_str() );
@ -382,10 +379,13 @@ int FfmpegCamera::OpenFfmpeg() {
Debug(4, "Calling av_find_stream_info");
if ( av_find_stream_info( mFormatContext ) < 0 )
#else
Debug(4, "Calling avformat_find_stream_info");
Debug(4, "Calling avformat_find_stream_info");
if ( avformat_find_stream_info( mFormatContext, 0 ) < 0 )
#endif
Fatal("Unable to find stream info from %s due to: %s", mPath.c_str(), strerror(errno));
{
Error("Unable to find stream info from %s due to: %s", mPath.c_str(), strerror(errno));
return -1;
}
startTime = av_gettime();//FIXME here or after find_Stream_info
Debug(4, "Got stream info");

View File

@ -2982,7 +2982,7 @@ Debug(4, "Return from Capture (%d)", captureResult);
if ( capture_image->Size() > camera->ImageSize() ) {
Error( "Captured image %d does not match expected size %d check width, height and colour depth",capture_image->Size(),camera->ImageSize() );
return( -1 );
return -1;
}
if ( (index == shared_data->last_read_index) && (function > MONITOR) ) {

View File

@ -241,6 +241,7 @@ int main(int argc, char *argv[]) {
int result = 0;
while( ! zm_terminate ) {
result = 0;
for ( int i = 0; i < n_monitors; i ++ ) {
time_t now = (time_t)time(NULL);
monitors[i]->setStartupTime(now);

View File

@ -57,7 +57,7 @@ function deleteEvents( element, name ) {
}
if ( count > 0 ) {
if ( confirm( confirmDeleteEventsString ) ) {
form.action.value = 'delete';
form.elements['action'].value = 'delete';
form.submit();
}
}
@ -120,13 +120,13 @@ function viewEvents( element, name ) {
function archiveEvents( element, name ) {
var form = element.form;
form.action.value = 'archive';
form.elements['action'].value = 'archive';
form.submit();
}
function unarchiveEvents( element, name ) {
function unarchiveEvents(element, name) {
var form = element.form;
form.action.value = 'unarchive';
form.elements['action'].value = 'unarchive';
form.submit();
}