Page 1 of 1

Small bugfix for zm_monitor.cpp

Posted: Tue Oct 10, 2006 7:01 am
by kamand
In function Monitor::Reload() missed field LinkedMonitors in select statement

Code: Select all

*** ../ZoneMinder-1.22.2.orig/src/zm_monitor.cpp        2006-05-05 12:42:31.000000000 +0300
--- ./src/zm_monitor.cpp        2006-10-10 09:14:42.000000000 +0300
***************
*** 1299,1305 ****
        closeEvent();

        static char sql[BUFSIZ];
!       snprintf( sql, sizeof(sql), "select Function+0, Enabled, EventPrefix, LabelFormat, LabelX, LabelY, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval, RefBlendPerc,
TrackMotion from Monitors where Id = '%d'", id );
        if ( mysql_query( &dbconn, sql ) )
        {
                Error(( "Can't run query: %s", mysql_error( &dbconn ) ));
--- 1299,1305 ----
        closeEvent();

        static char sql[BUFSIZ];
!       snprintf( sql, sizeof(sql), "select Function+0, Enabled, LinkedMonitors, EventPrefix, LabelFormat, LabelX, LabelY, WarmupCount, PreEventCount, PostEventCount, AlarmFrameCount, SectionLength, FrameSkip, MaxFPS, AlarmMaxFPS, FPSReportInterval
, RefBlendPerc, TrackMotion from Monitors where Id = '%d'", id );
        if ( mysql_query( &dbconn, sql ) )
        {
                Error(( "Can't run query: %s", mysql_error( &dbconn ) ));

Is it possible file attacments in forum ?

Posted: Tue Oct 10, 2006 1:25 pm
by zoneminder
Yes, I think you are correct. Thanks for posting that.

Where you asking about attachements because you wanted to post a patch? If so then you can always mail it to me and I will host it.

Posted: Fri Oct 13, 2006 11:59 am
by kamand
zoneminder wrote: Where you asking about attachements because you wanted to post a patch? If so then you can always mail it to me and I will host it.
Yes, because text formatting was lost.
Yet another small fix zmwatch.pl line 93 divide by zero:

Code: Select all

 diff -u zmwatch.pl.orig zmwatch.pl
--- zmwatch.pl.orig     2006-10-13 14:39:53.000000000 +0300
+++ zmwatch.pl  2006-10-13 14:41:46.000000000 +0300
@@ -90,7 +90,7 @@
                                next if ( !defined($image_time) ); # Can't read from shared memory
                                next if ( !$image_time ); # We can't get the last capture time so can't be sure it's died.

-                               my $max_image_delay = ($monitor->{MaxFPS}&&($monitor->{MaxFPS}<1))?(3/$monitor->{MaxFPS}):ZM_WATCH_MAX_DELAY;
+                               my $max_image_delay = ($monitor->{MaxFPS}&&($monitor->{MaxFPS}<1)&&($monitor->{MaxFPS}>0))?(3/$monitor->{MaxFPS}):ZM_WATCH_MAX_DELAY;
                                my $image_delay = $now-$image_time;
                                Debug( "Monitor $monitor->{Id} last captured $image_delay seconds ago, max is $max_image_delay\n" );
                                if ( $image_delay <= $max_image_delay )


Posted: Fri Oct 13, 2006 3:24 pm
by zoneminder
Thanks again. I have made a note of this one also.