Merge branch 'master' into fix_token_auth_sessions

This commit is contained in:
Isaac Connor 2019-08-19 11:13:24 -04:00
commit bf34d8901e
10 changed files with 34 additions and 27 deletions

View File

@ -9,4 +9,5 @@
endscript
daily
rotate 7
maxage 7
}

View File

@ -9,4 +9,5 @@
endscript
daily
rotate 7
maxage 7
}

View File

@ -116,7 +116,7 @@ bool EventStream::loadEventData(uint64_t event_id) {
snprintf(sql, sizeof(sql),
"SELECT `MonitorId`, `StorageId`, `Frames`, unix_timestamp( `StartTime` ) AS StartTimestamp, "
"(SELECT max(`Delta`)-min(`Delta`) FROM `Frames` WHERE `EventId`=`Events.Id`) AS Duration, "
"(SELECT max(`Delta`)-min(`Delta`) FROM `Frames` WHERE `EventId`=`Events`.`Id`) AS Duration, "
"`DefaultVideo`, `Scheme`, `SaveJPEGs` FROM `Events` WHERE `Id` = %" PRIu64, event_id);
if ( mysql_query(&dbconn, sql) ) {
@ -674,7 +674,7 @@ bool EventStream::sendFrame(int delta_us) {
fdj = fopen(filepath, "rb");
if ( !fdj ) {
Error("Can't open %s: %s", filepath, strerror(errno));
return false;
return true; // returning false will cause us to terminate.
}
#if HAVE_SENDFILE
if ( fstat(fileno(fdj),&filestat) < 0 ) {
@ -829,12 +829,6 @@ void EventStream::runStream() {
Debug(2, "Not checking command queue");
}
//if ( step != 0 )// Adding 0 is cheaper than an if 0
// curr_frame_id starts at 1 though, so we might skip the first frame?
curr_frame_id += step;
// Detects when we hit end of event and will load the next event or previous event
checkEventLoaded();
// Get current frame data
FrameData *frame_data = &event_data->frames[curr_frame_id-1];
@ -926,7 +920,6 @@ void EventStream::runStream() {
} // end if streaming stepping or doing nothing
if ( send_frame ) {
//Debug(3,"sending frame");
if ( !sendFrame(delta_us) )
zm_terminate = true;
}
@ -958,8 +951,11 @@ void EventStream::runStream() {
// or calc the relationship from the last frame. I think from the start is better as it self-corrects
if ( send_frame && type != STREAM_MPEG ) {
if ( delta_us > 0 ) {
Debug(3, "dUs: %d", delta_us);
if ( delta_us > 0) {
if ( delta_us > MAX_SLEEP_USEC ) {
Debug(1, "Limiting sleep to %d because calculated sleep is too long %d", MAX_SLEEP_USEC, delta_us);
delta_us = MAX_SLEEP_USEC;
}
usleep(delta_us);
Debug(3, "Done sleeping: %d usec", delta_us);
}
@ -971,16 +967,23 @@ void EventStream::runStream() {
(unsigned long)((1000000 * ZM_RATE_BASE)/((base_fps?base_fps:1)*abs(replay_rate*2))),
ZM_RATE_BASE,
(base_fps?base_fps:1),
(replay_rate?abs(replay_rate*2):200)
(replay_rate?abs(replay_rate*2):0)
);
if ( delta_us > 0 and delta_us < 500000 ) {
if ( delta_us > 0 ) {
if ( delta_us > MAX_SLEEP_USEC ) {
Debug(1, "Limiting sleep to %d because calculated sleep is too long %d", MAX_SLEEP_USEC, delta_us);
delta_us = MAX_SLEEP_USEC;
}
usleep(delta_us);
} else {
// Never want to sleep for too long, limit to .1s
Warning("sleeping .5s because delta_us (%d) not good!", delta_us);
usleep(500000);
}
} // end if !paused
//if ( step != 0 )// Adding 0 is cheaper than an if 0
// curr_frame_id starts at 1 though, so we might skip the first frame?
curr_frame_id += step;
// Detects when we hit end of event and will load the next event or previous event
checkEventLoaded();
} // end while ! zm_terminate
#if HAVE_LIBAVCODEC
if ( type == STREAM_MPEG )

View File

@ -482,7 +482,7 @@ int FfmpegCamera::OpenFfmpeg() {
hw_pix_fmt = find_fmt_by_hw_type(type);
#endif
if ( hw_pix_fmt != AV_PIX_FMT_NONE ) {
Debug(1, "Selected gw_pix_fmt %d %s",
Debug(1, "Selected hw_pix_fmt %d %s",
hw_pix_fmt,
av_get_pix_fmt_name(hw_pix_fmt));

View File

@ -976,7 +976,7 @@ void Monitor::actionDisable() {
shared_data->action |= RELOAD;
static char sql[ZM_SQL_SML_BUFSIZ];
snprintf(sql, sizeof(sql), "UPDATE `Monitors` SET i`Enabled` = 0 WHERE `Id` = %d", id);
snprintf(sql, sizeof(sql), "UPDATE `Monitors` SET `Enabled` = 0 WHERE `Id` = %d", id);
db_mutex.lock();
if ( mysql_query(&dbconn, sql) ) {
Error("Can't run query: %s", mysql_error(&dbconn));

View File

@ -36,6 +36,7 @@ public:
protected:
static const int MAX_STREAM_DELAY = 5; // Seconds
static const int MAX_SLEEP_USEC = 500000; // .5 Seconds
static const StreamType DEFAULT_TYPE = STREAM_JPEG;
enum { DEFAULT_RATE=ZM_RATE_BASE };

View File

@ -300,7 +300,7 @@ $SLANG = array(
'Display' => 'Display',
'Displaying' => 'Displaying',
'DonateAlready' => 'No, I\'ve already donated',
'DonateEnticement' => 'You\'ve been running ZoneMinder for a while now and hopefully are finding it a useful addition to your home or workplace security. Although ZoneMinder is, and will remain, free and open source, it costs money to develop and support. If you would like to help support future development and new features then please consider donating. Donating is, of course, optional but very much appreciated and you can donate as much or as little as you like.<br/><br/>If you would like to donate please select the option below or go to https://zoneminder.com/donate/ in your browser.<br/><br/>Thank you for using ZoneMinder and don\'t forget to visit the forums on ZoneMinder.com for support or suggestions about how to make your ZoneMinder experience even better.',
'DonateEnticement' => 'You\'ve been running ZoneMinder for a while now and hopefully are finding it a useful addition to your home or workplace security. Although ZoneMinder is, and will remain, free and open source, it costs money to develop and support. If you would like to help support future development and new features then please consider donating. Donating is, of course, optional but very much appreciated and you can donate as much or as little as you like.<br/><br/>If you would like to donate please select the option below or go to <a href="https://zoneminder.com/donate/" target="_blank">https://zoneminder.com/donate/</a> in your browser.<br/><br/>Thank you for using ZoneMinder and don\'t forget to visit the forums on <a href="https://forums.zoneminder.com">ZoneMinder.com</a> for support or suggestions about how to make your ZoneMinder experience even better.',
'Donate' => 'Please Donate',
'DonateRemindDay' => 'Not yet, remind again in 1 day',
'DonateRemindHour' => 'Not yet, remind again in 1 hour',

View File

@ -324,14 +324,14 @@ th.table-th-sort span.table-th-sort-span {
float: right;
width: 12px;
height: 12px;
background: url("/skins/classic/graphics/arrow-s-u.png") no-repeat 0 0;
background: url("../skins/classic/graphics/arrow-s-u.png") no-repeat 0 0;
}
th.table-th-sort-rev span.table-th-sort-span {
float: right;
width: 12px;
height: 12px;
background: url("/skins/classic/graphics/arrow-s-d.png") no-repeat 0 0;
background: url("../skins/classic/graphics/arrow-s-d.png") no-repeat 0 0;
}
.table-tr-odd {

View File

@ -328,7 +328,8 @@ for( $monitor_i = 0; $monitor_i < count($displayMonitors); $monitor_i += 1 ) {
?>
<td class="colMark">
<input type="checkbox" name="markMids[]" value="<?php echo $monitor['Id'] ?>" data-on-click-this="setButtonStates"<?php if ( !canEdit( 'Monitors' ) ) { ?> disabled="disabled"<?php } ?>/>
<span class="glyphicon glyphicon-sort" title="Click and drag to change order"></span>
<!--<span class="glyphicon glyphicon-sort" title="Click and drag to change order"></span>-->
<i class="material-icons sort" title="Click and drag to change order">swap_vert</i>
</td>
<?php
}

View File

@ -117,18 +117,18 @@ function reloadWindow() {
}
function initPage() {
reloadWindow.periodical( consoleRefreshTimeout );
reloadWindow.periodical(consoleRefreshTimeout);
if ( showVersionPopup ) {
createPopup( '?view=version', 'zmVersion', 'version' );
createPopup('?view=version', 'zmVersion', 'version');
}
if ( showDonatePopup ) {
createPopup( '?view=donate', 'zmDonate', 'donate' );
createPopup('?view=donate', 'zmDonate', 'donate');
}
// Makes table sortable
$j( function() {
$j( "#consoleTableBody" ).sortable({
handle: ".glyphicon-sort",
handle: ".sort",
update: applySort,
axis: 'Y'} );
$j( "#consoleTableBody" ).disableSelection();