From 03cae9d2f23e861084355a109262233d804175f8 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Fri, 1 Apr 2016 14:06:28 -0400 Subject: [PATCH] Add video file to event data. --- src/zm_event.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 095c08480..497403e66 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -861,7 +861,7 @@ bool EventStream::loadEventData( int event_id ) { static char sql[ZM_SQL_MED_BUFSIZ]; - snprintf( sql, sizeof(sql), "select M.Id, M.Name, E.StorageId, E.Frames, unix_timestamp( StartTime ) as StartTimestamp, max(F.Delta)-min(F.Delta) as Duration from Events as E inner join Monitors as M on E.MonitorId = M.Id inner join Frames as F on E.Id = F.EventId where E.Id = %d group by E.Id", event_id ); + snprintf( sql, sizeof(sql), "select M.Id, M.Name, E.StorageId, E.Frames, unix_timestamp( StartTime ) as StartTimestamp, max(F.Delta)-min(F.Delta) as Duration,E.DefaultVideo from Events as E inner join Monitors as M on E.MonitorId = M.Id inner join Frames as F on E.Id = F.EventId where E.Id = %d group by E.Id", event_id ); if ( mysql_query( &dbconn, sql ) ) { @@ -916,6 +916,7 @@ bool EventStream::loadEventData( int event_id ) } event_data->frame_count = dbrow[3] == NULL ? 0 : atoi(dbrow[3]); event_data->duration = atof(dbrow[5]); + strncpy( event_data->video_file, dbrow[6], sizeof( event_data->video_file )-1 ); updateFrameRate( (double)event_data->frame_count/event_data->duration );