MT#56493 track call/stream start times

Change-Id: I74d77d26ad40501b77502a382150ef7003f52f3a
pull/1611/head
Richard Fuchs 2 years ago
parent e9568c8e31
commit f861d984aa

@ -256,11 +256,9 @@ static void db_do_call_id(metafile_t *mf) {
if (!mf->call_id)
return;
double now = now_double();
MYSQL_BIND b[2];
my_cstr(&b[0], mf->call_id);
my_d(&b[1], &now);
my_d(&b[1], &mf->start_time);
execute_wrap(&stm_insert_call, b, &mf->db_id);
}
@ -315,7 +313,6 @@ void db_do_stream(metafile_t *mf, output_t *op, stream_t *stream, unsigned long
return;
unsigned long id = stream ? stream->id : 0;
double now = now_double();
MYSQL_BIND b[11];
my_ull(&b[0], &mf->db_id);
@ -343,7 +340,7 @@ void db_do_stream(metafile_t *mf, output_t *op, stream_t *stream, unsigned long
}
else
my_cstr(&b[9], "");
my_d(&b[10], &now);
my_d(&b[10], &op->start_time);
execute_wrap(&stm_insert_stream, b, &op->db_id);

@ -233,6 +233,7 @@ static metafile_t *metafile_get(char *name) {
mf->forward_count = 0;
mf->forward_failed = 0;
mf->recording_on = 1;
mf->start_time = now_double();
if (decoding_enabled) {
pthread_mutex_init(&mf->payloads_lock, NULL);

@ -10,6 +10,7 @@
#include "log.h"
#include "db.h"
#include "main.h"
#include "recaux.h"
//static int output_codec_id;
@ -91,6 +92,7 @@ static output_t *output_alloc(const char *path, const char *name) {
ret->channel_mult = 1;
ret->requested_format.format = -1;
ret->actual_format.format = -1;
ret->start_time = now_double();
return ret;
}

@ -11,6 +11,7 @@
#include "main.h"
#include "packet.h"
#include "forward.h"
#include "recaux.h"
#define MAXBUFLEN 65535
@ -107,6 +108,7 @@ static stream_t *stream_get(metafile_t *mf, unsigned long id) {
ret->id = id;
ret->metafile = mf;
ret->tag = (unsigned long) -1;
ret->start_time = now_double();
out:
return ret;

@ -55,6 +55,7 @@ struct stream_s {
int fd;
handler_t handler;
unsigned int forwarding_on:1;
double start_time;
};
typedef struct stream_s stream_t;
@ -116,6 +117,7 @@ struct metafile_s {
off_t pos;
unsigned long long db_id;
unsigned int db_streams;
double start_time;
GStringChunk *gsc; // XXX limit max size
@ -152,6 +154,7 @@ struct output_s {
unsigned long long db_id;
gboolean skip_filename_extension;
unsigned int channel_mult;
double start_time;
AVFormatContext *fmtctx;
AVStream *avst;

Loading…
Cancel
Save