Small bugfix for zm_monitor.cpp

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
kamand
Posts: 24
Joined: Fri Nov 28, 2003 10:04 am

Small bugfix for zm_monitor.cpp

Post 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 ?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post 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.
Phil
kamand
Posts: 24
Joined: Fri Nov 28, 2003 10:04 am

Post 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 )

User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Thanks again. I have made a note of this one also.
Phil
Post Reply