Skip to content

Commit

Permalink
Merge branch 'master' of github.com:ZoneMinder/zoneminder
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac Connor committed Jul 9, 2024
2 parents cb35a6d + b4c871d commit c210453
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/zmupdate.pl.in
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,7 @@ if ( $version ) {
foreach my $patch ( @files ) {
my ( $v ) = $patch =~ /^zm_update\-([\d\.]+)\.sql$/;
#PP make sure we use version compare
if ( version->parse('v'.$v) > version->parse('v'.$version) ) {
if ( version->parse('v'.$v) >= version->parse('v'.$version) ) {
print("Upgrading DB to $v from $version\n");
if ( patchDB($dbh, $v) ) {
my $res = $sth->execute($version) or die( "Can't execute: ".$sth->errstr() );
Expand Down
5 changes: 3 additions & 2 deletions src/zm_ffmpeg_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ int FfmpegCamera::Capture(std::shared_ptr<ZMPacket> &zm_packet) {
Info("Unable to read packet from stream %d: error %d \"%s\".",
packet->stream_index, ret, av_make_error_string(ret).c_str());
} else {
Error("Unable to read packet from stream %d: error %d \"%s\".",
packet->stream_index, ret, av_make_error_string(ret).c_str());
logPrintf(Logger::ERROR + monitor->Importance(),
"Unable to read packet from stream %d: error %d \"%s\".",
packet->stream_index, ret, av_make_error_string(ret).c_str());
}
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/zm_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ Image::Image(const AVFrame *frame, int p_width, int p_height) :
static void dont_free(void *opaque, uint8_t *data) {
}

int Image::PopulateFrame(AVFrame *frame) {
int Image::PopulateFrame(AVFrame *frame) const {
Debug(1, "PopulateFrame: width %d height %d linesize %d colours %d imagesize %d %s",
width, height, linesize, colours, size,
av_get_pix_fmt_name(imagePixFormat)
Expand Down
4 changes: 4 additions & 0 deletions src/zm_signal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

bool zm_reload = false;
bool zm_terminate = false;
bool zm_panic = false;

RETSIGTYPE zm_hup_handler(int signal) {
// Shouldn't do complex things in signal handlers, logging is complex and can block due to mutexes.
Expand All @@ -47,6 +48,9 @@ RETSIGTYPE zm_die_handler(int signal)
#endif
{
zm_terminate = true;
if (zm_panic)
Panic("Got signal %d (%s), crashing", signal, strsignal(signal));
zm_panic = true;
Error("Got signal %d (%s), crashing", signal, strsignal(signal));
#if (defined(__i386__) || defined(__x86_64__))
// Get more information if available
Expand Down
8 changes: 8 additions & 0 deletions src/zms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include "zm_monitorstream.h"
#include "zm_eventstream.h"
#include "zm_fifo_stream.h"
#include <iomanip>
#include <sstream>
#include <string>
#include <unistd.h>

Expand Down Expand Up @@ -154,6 +156,12 @@ int main(int argc, const char *argv[], char **envp) {
monitor_id = atoi(value);
if ( source == ZMS_UNKNOWN )
source = ZMS_MONITOR;
} else if ( !strcmp(name, "datetime") ) {
std::tm tm = {};
std::stringstream ss(value);
ss >> std::get_time(&tm, "%Y-%m-%d %H:%M:%S");
auto tp = std::chrono::system_clock::from_time_t(std::mktime(&tm));
event_time = std::chrono::duration_cast<FPSeconds>(tp.time_since_epoch()).count();
} else if ( !strcmp(name, "time") ) {
event_time = atoi(value);
} else if ( !strcmp(name, "event") ) {
Expand Down
1 change: 1 addition & 0 deletions web/includes/actions/monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
'Exif' => 0,
'RTSPDescribe' => 0,
'V4LMultiBuffer' => '',
'WallClockTimestamps' => '',
'RecordAudio' => 0,
'Method' => 'raw',
'GroupIds' => array(),
Expand Down

0 comments on commit c210453

Please sign in to comment.