mirror of
https://github.com/Motion-Project/motion.git
synced 2026-05-24 06:27:41 -04:00
Merge branch 'lastsnap' of https://github.com/jdodgen/motion into jdodgen-lastsnap
This commit is contained in:
15
event.c
15
event.c
@@ -402,10 +402,15 @@ static void event_image_snapshot(struct context *cnt,
|
||||
void *dummy2 ATTRIBUTE_UNUSED, struct tm *currenttime_tm)
|
||||
{
|
||||
char fullfilename[PATH_MAX];
|
||||
char filename[PATH_MAX];
|
||||
char filepath[PATH_MAX];
|
||||
int offset = 0;
|
||||
int len = strlen(cnt->conf.snappath);
|
||||
|
||||
if (strcmp(cnt->conf.snappath, "lastsnap")) {
|
||||
char filename[PATH_MAX];
|
||||
char filepath[PATH_MAX];
|
||||
if (len >= 9)
|
||||
offset = len - 8;
|
||||
|
||||
if (strcmp(cnt->conf.snappath+offset, "lastsnap")) {
|
||||
char linkpath[PATH_MAX];
|
||||
const char *snappath;
|
||||
/*
|
||||
@@ -435,7 +440,9 @@ static void event_image_snapshot(struct context *cnt,
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
snprintf(fullfilename, PATH_MAX, "%s/lastsnap.%s", cnt->conf.filepath, imageext(cnt));
|
||||
mystrftime(cnt, filepath, sizeof(filepath), cnt->conf.snappath, currenttime_tm, NULL, 0);
|
||||
snprintf(filename, PATH_MAX, "%s.%s", filepath, imageext(cnt));
|
||||
snprintf(fullfilename, PATH_MAX, "%s/%s", cnt->conf.filepath, filename);
|
||||
remove(fullfilename);
|
||||
put_picture(cnt, fullfilename, img, FTYPE_IMAGE_SNAPSHOT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user