Merge branch 'master' of github.com:ZoneMinder/ZoneMinder

This commit is contained in:
Isaac Connor 2019-09-09 16:16:49 -04:00
commit 9682edd080
5 changed files with 37 additions and 31 deletions

View File

@ -37,8 +37,16 @@ env:
- SMPFLAGS=-j4 OS=fedora DIST=29 DOCKER_REPO=knnniggett/packpack
- SMPFLAGS=-j4 OS=ubuntu DIST=trusty
- SMPFLAGS=-j4 OS=ubuntu DIST=xenial
- SMPFLAGS=-j4 OS=ubuntu DIST=bionic
- SMPFLAGS=-j4 OS=ubuntu DIST=disco
- SMPFLAGS=-j4 OS=debian DIST=buster
- SMPFLAGS=-j4 OS=debian DIST=stretch
- SMPFLAGS=-j4 OS=ubuntu DIST=trusty ARCH=i386
- SMPFLAGS=-j4 OS=ubuntu DIST=xenial ARCH=i386
- SMPFLAGS=-j4 OS=ubuntu DIST=bionic ARCH=i386
- SMPFLAGS=-j4 OS=ubuntu DIST=disco ARCH=i386
- SMPFLAGS=-j4 OS=debian DIST=buster ARCH=i386
- SMPFLAGS=-j4 OS=debian DIST=stretch ARCH=i386
- SMPFLAGS=-j4 OS=raspbian DIST=stretch ARCH=armhf DOCKER_REPO=knnniggett/packpack
compiler:

View File

@ -20,13 +20,14 @@
#define __STDC_FORMAT_MACROS 1
#include <cinttypes>
#include <stdlib.h>
#include <string.h>
#include "zm.h"
#include "zm_videostore.h"
#include <stdlib.h>
#include <string.h>
#include <cinttypes>
extern "C" {
#include "libavutil/time.h"
}
@ -653,7 +654,7 @@ bool VideoStore::setup_resampler() {
#else
// codec is already open in ffmpeg_camera
audio_in_ctx = audio_in_stream->codec;
audio_in_codec = (AVCodec *)audio_in_ctx->codec;
audio_in_codec = reinterpret_cast<AVCodec *>audio_in_ctx->codec;
//audio_in_codec = avcodec_find_decoder(audio_in_stream->codec->codec_id);
#endif
@ -867,7 +868,7 @@ bool VideoStore::setup_resampler() {
NULL, audio_out_ctx->channels,
audio_out_ctx->frame_size,
audio_out_ctx->sample_fmt, 0);
converted_in_samples = (uint8_t *)av_malloc(audioSampleBuffer_size);
converted_in_samples = reinterpret_cast<uint8_t *>(av_malloc(audioSampleBuffer_size));
if ( !converted_in_samples ) {
Error("Could not allocate converted in sample pointers");
@ -971,7 +972,7 @@ int VideoStore::writeVideoFramePacket(AVPacket *ipkt) {
// && ( ipkt->dts >= 0 ) ) {
// This is the first packet.
opkt.dts = 0;
Debug(1, "Starting video first_dts will become (%" PRId64 ")", ipkt->dts);
Debug(2, "Starting video first_dts will become (%" PRId64 ")", ipkt->dts);
video_first_dts = ipkt->dts;
#if 1
if ( audio_in_stream ) {

View File

@ -142,16 +142,14 @@ class Event extends ZM_Object {
# Assumption: All events have a start time
$start_date = date_parse($this->{'StartTime'});
if ( ! $start_date ) {
Error('Unable to parse start time for event ' . $this->{'Id'} . ' not deleting files.');
return;
throw new Exception('Unable to parse start time for event ' . $this->{'Id'} . ' not deleting files.');
}
$start_date['year'] = $start_date['year'] % 100;
# So this is because ZM creates a link under the day pointing to the time that the event happened.
$link_path = $this->Link_Path();
if ( ! $link_path ) {
Error('Unable to determine link path for event '.$this->{'Id'}.' not deleting files.');
return;
throw new Exception('Unable to determine link path for event '.$this->{'Id'}.' not deleting files.');
}
$Storage = $this->Storage();
@ -159,8 +157,7 @@ class Event extends ZM_Object {
if ( $id_files = glob($eventlink_path) ) {
if ( ! $eventPath = readlink($id_files[0]) ) {
Error("Unable to read link at $id_files[0]");
return;
throw new Exception("Unable to read link at $id_files[0]");
}
# I know we are using arrays here, but really there can only ever be 1 in the array
$eventPath = preg_replace('/\.'.$this->{'Id'}.'$/', $eventPath, $id_files[0]);
@ -179,8 +176,7 @@ class Event extends ZM_Object {
} else {
$eventPath = $this->Path();
if ( ! $eventPath ) {
Error('No event Path in Event delete. Not deleting');
return;
throw new Exception('No event Path in Event delete. Not deleting');
}
deletePath($eventPath);
if ( $this->SecondaryStorageId() ) {
@ -199,6 +195,9 @@ class Event extends ZM_Object {
$dbConn->commit();
} catch (PDOException $e) {
$dbConn->rollback();
} catch (Exception $e) {
Error($e->getMessage());
$dbConn->rollback();
}
} # end Event->delete

View File

@ -44,11 +44,9 @@ if ( $action == 'archive' ) {
$dbConn->commit();
$refreshParent = true;
} else if ( $action == 'delete' ) {
$dbConn->beginTransaction();
foreach ( getAffectedIds('eids') as $markEid ) {
deleteEvent($markEid);
}
$dbConn->commit();
$refreshParent = true;
}
?>