diff --git a/db/zm_create.sql.in b/db/zm_create.sql.in index d0a063642..0f70fdcc6 100644 --- a/db/zm_create.sql.in +++ b/db/zm_create.sql.in @@ -657,9 +657,9 @@ CREATE TABLE `Servers` ( `FreeMem` bigint unsigned default null, `TotalSwap` bigint unsigned default null, `FreeSwap` bigint unsigned default null, - `zmstats.pl` BOOLEAN NOT NULL DEFAULT FALSE, - `zmaudit.pl` BOOLEAN NOT NULL DEFAULT FALSE, - `zmtrigger.pl` BOOLEAN NOT NULL DEFAULT FALSE, + `zmstats` BOOLEAN NOT NULL DEFAULT FALSE, + `zmaudit` BOOLEAN NOT NULL DEFAULT FALSE, + `zmtrigger` BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (`Id`) ) ENGINE=@ZM_MYSQL_ENGINE@; diff --git a/db/zm_update-1.31.23.sql b/db/zm_update-1.31.23.sql new file mode 100644 index 000000000..1e4b6795c --- /dev/null +++ b/db/zm_update-1.31.23.sql @@ -0,0 +1,35 @@ +SET @s = (SELECT IF( + (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE() + AND table_name = 'Servers' + AND column_name = 'zmstats.pl' + ) > 0, + "ALTER TABLE Servers CHANGE COLUMN `zmstats.pl` `zmstats` BOOLEAN NOT NULL DEFAULT FALSE", + "SELECT 'zmstats.pl has already been changed to zmstats'" + )); + +PREPARE stmt FROM @s; +EXECUTE stmt; + +SET @s = (SELECT IF( + (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE() + AND table_name = 'Servers' + AND column_name = 'zmaudit.pl' + ) > 0, + "ALTER TABLE Servers CHANGE COLUMN `zmaudit.pl` `zmaudit` BOOLEAN NOT NULL DEFAULT FALSE", + "SELECT 'zmaudit.pl has already been changed to zmaudit'" + )); + +PREPARE stmt FROM @s; +EXECUTE stmt; + +SET @s = (SELECT IF( + (SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE() + AND table_name = 'Servers' + AND column_name = 'zmtrigger.pl' + ) > 0, + "ALTER TABLE Servers CHANGE COLUMN `zmtrigger.pl` `zmtrigger` BOOLEAN NOT NULL DEFAULT FALSE", + "SELECT 'zmtrigger.pl has already been changed to zmtrigger'" + )); + +PREPARE stmt FROM @s; +EXECUTE stmt; diff --git a/scripts/zmdc.pl.in b/scripts/zmdc.pl.in index ce95058e6..0efe9ec27 100644 --- a/scripts/zmdc.pl.in +++ b/scripts/zmdc.pl.in @@ -319,11 +319,7 @@ sub run { my ( $command, $daemon, @args ) = split( /;/, $message ); if ( $command eq 'start' ) { - if ( $Server and exists $$Server{$daemon} and ! $$Server{$daemon} ) { - Debug("Not running $daemon because it is turned off for this server."); - } else { - start( $daemon, @args ); - } + start( $daemon, @args ); } elsif ( $command eq 'stop' ) { stop( $daemon, @args ); } elsif ( $command eq 'restart' ) { diff --git a/scripts/zmpkg.pl.in b/scripts/zmpkg.pl.in index f7184affd..3daadbc26 100644 --- a/scripts/zmpkg.pl.in +++ b/scripts/zmpkg.pl.in @@ -230,14 +230,14 @@ if ( $command =~ /^(?:start|restart)$/ ) { # This is now started unconditionally runCommand('zmdc.pl start zmfilter.pl'); if ( $Config{ZM_RUN_AUDIT} ) { - if ( $Server and exists $$Server{'zmaudit.pl'} and ! $$Server{'zmaudit.pl'} ) { + if ( $Server and exists $$Server{'zmaudit'} and ! $$Server{'zmaudit'} ) { Debug("Not running zmaudit.pl because it is turned off for this server."); } else { runCommand('zmdc.pl start zmaudit.pl -c'); } } if ( $Config{ZM_OPT_TRIGGERS} ) { - if ( $Server and exists $$Server{'zmtrigger.pl'} and ! $$Server{'zmtrigger.pl'} ) { + if ( $Server and exists $$Server{'zmtrigger'} and ! $$Server{'zmtrigger'} ) { Debug("Not running zmtrigger.pl because it is turned off for this server."); } else { runCommand('zmdc.pl start zmtrigger.pl'); @@ -253,7 +253,7 @@ if ( $command =~ /^(?:start|restart)$/ ) { if ( $Config{ZM_TELEMETRY_DATA} ) { runCommand('zmdc.pl start zmtelemetry.pl'); } - if ( $Server and exists $$Server{'zmstats.pl'} and ! $$Server{'zmstats.pl'} ) { + if ( $Server and exists $$Server{'zmstats'} and ! $$Server{'zmstats'} ) { Debug("Not running zmstats.pl because it is turned off for this server."); } else { runCommand('zmdc.pl start zmstats.pl'); diff --git a/src/zm_ffmpeg_camera.cpp b/src/zm_ffmpeg_camera.cpp index 7e87ee576..e5768abe4 100644 --- a/src/zm_ffmpeg_camera.cpp +++ b/src/zm_ffmpeg_camera.cpp @@ -414,9 +414,9 @@ int FfmpegCamera::OpenFfmpeg() { #endif Fatal( "Unable to open codec for video stream from %s", mPath.c_str() ); } + Debug ( 1, "Opened audio codec" ); } // end if have audio stream - Debug ( 1, "Opened audio codec" ); if ( (unsigned int)mVideoCodecContext->width != width || (unsigned int)mVideoCodecContext->height != height ) { Warning( "Monitor dimensions are %dx%d but camera is sending %dx%d", width, height, mVideoCodecContext->width, mVideoCodecContext->height ); diff --git a/src/zm_packetqueue.cpp b/src/zm_packetqueue.cpp index 3c2ae4490..e7dc6dfae 100644 --- a/src/zm_packetqueue.cpp +++ b/src/zm_packetqueue.cpp @@ -149,9 +149,17 @@ unsigned int zm_packetqueue::clearQueue( unsigned int frames_to_keep, int stream // Want frames_to_keep video keyframes. Otherwise, we may not have enough if ( ( av_packet->stream_index == stream_id) && ( av_packet->flags & AV_PKT_FLAG_KEY ) ) { + Debug(4, "Found keyframe at packet with stream index (%d) with keyframe (%d), frames_to_keep is (%d)", av_packet->stream_index, ( av_packet->flags & AV_PKT_FLAG_KEY ), frames_to_keep ); break; } } + if ( frames_to_keep ) { + Debug(3, "Hit end of queue, still need (%d) video frames", frames_to_keep ); + } + if ( it != pktQueue.rend() ) { + // We want to keep this packet, so advance to the next + it ++; + } unsigned int delete_count = 0; Debug(4, "Deleting packets from the front, count is (%d)", delete_count ); while ( it != pktQueue.rend() ) { diff --git a/version b/version index f6cb7f351..c9996cab5 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.31.22 +1.31.23