Merge branch 'master' into multistream

This commit is contained in:
Isaac Connor 2022-01-11 10:48:27 -05:00
commit 1f9d3c46aa
5 changed files with 26 additions and 13 deletions

@ -1 +1 @@
Subproject commit 1b40f1661f93f50fd5805f239d1e466a3bcf888f
Subproject commit cd7fd49becad6010a1b8466bfebbd93999a39878

View File

@ -3306,9 +3306,9 @@ void neon32_armv7_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* r
__attribute__((noinline)) void neon64_armv8_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count, double blendpercent) {
#if (defined(__aarch64__) && !defined(ZM_STRIP_NEON))
static double current_blendpercent = 0.0;
static int8_t divider = 0;
if (current_blendpercent != blendpercent) {
static int8_t divider = 0;
/* Attempt to match the blending percent to one of the possible values */
if(blendpercent < 2.34375) {
// 1.5625% blending

View File

@ -2145,7 +2145,10 @@ bool Monitor::Analyse() {
name.c_str(), analysis_image_count, event->Id(), event->Frames(), event->AlarmFrames());
//if ( function != MOCORD || event_close_mode == CLOSE_ALARM || event->Cause() == SIGNAL_CAUSE )
if (event) {
if ((recording == RECORDING_ONMOTION) || (event_close_mode == CLOSE_ALARM) ) {
if ((recording == RECORDING_ONMOTION)
||
(event_close_mode == CLOSE_ALARM || event_close_mode==CLOSE_IDLE)
) {
shared_data->state = state = IDLE;
Info("%s: %03d - Closing event %" PRIu64 ", alarm end%s",
name.c_str(), analysis_image_count, event->Id(), (function==MOCORD)?", section truncated":"" );

View File

@ -120,16 +120,18 @@ std::string Join(const StringVector &values, const std::string &delim) {
std::string stringtf(const char* format, ...) {
va_list args;
va_start(args, format);
int size = vsnprintf(nullptr, 0, format, args) + 1; // Extra space for '\0'
va_end(args);
if (size <= 0) {
throw std::runtime_error("Error during formatting.");
}
std::unique_ptr<char[]> buf(new char[size]);
va_list args2;
va_copy(args2, args);
int size = vsnprintf(nullptr, 0, format, args);
va_end(args);
if (size < 0) {
va_end(args2);
throw std::runtime_error("Error during formatting.");
}
size += 1; // Extra space for '\0'
std::unique_ptr<char[]> buf(new char[size]);
vsnprintf(buf.get(), size, format, args2);
va_end(args2);

View File

@ -501,8 +501,16 @@ bool VideoStore::open() {
Debug(1, "using movflags %s", movflags_entry->value);
}
if ((ret = avformat_write_header(oc, &opts)) < 0) {
Warning("Unable to set movflags trying with defaults.");
ret = avformat_write_header(oc, nullptr);
// we crash if we try again
if (ENOSPC != ret) {
Warning("Unable to set movflags trying with defaults.%d %s",
ret, av_make_error_string(ret).c_str());
ret = avformat_write_header(oc, nullptr);
Debug(1, "Done %d", ret);
} else {
Error("ENOSPC. fail");
}
} else if (av_dict_count(opts) != 0) {
Info("some options not used, turn on debugging for a list.");
AVDictionaryEntry *e = nullptr;