Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
DVR: save real start/stop times for filename
  • Loading branch information
perexg committed Apr 14, 2016
1 parent 616413f commit 3944bd1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dvr/dvr_db.c
Expand Up @@ -2029,6 +2029,7 @@ dvr_entry_class_save(idnode_t *self, char *filename, size_t fsize)
htsmsg_field_t *f;
char ubuf[UUID_HEX_SIZE];
const char *filename2;
int64_t s64;

idnode_save(&de->de_id, m);
if (de->de_files) {
Expand All @@ -2042,6 +2043,10 @@ dvr_entry_class_save(idnode_t *self, char *filename, size_t fsize)
htsmsg_add_str(c, "filename", filename2);
if (info)
htsmsg_add_msg(c, "info", htsmsg_copy(info));
if (!htsmsg_get_s64(e, "start", &s64))
htsmsg_add_s64(c, "start", s64);
if (!htsmsg_get_s64(e, "stop", &s64))
htsmsg_add_s64(c, "stop", s64);
htsmsg_add_msg(l, NULL, c);
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/dvr/dvr_rec.c
Expand Up @@ -1060,6 +1060,7 @@ dvr_rec_start(dvr_entry_t *de, const streaming_start_t *ss)
if ((f = htsmsg_field_last(de->de_files)) != NULL &&
(e = htsmsg_field_get_map(f)) != NULL) {
htsmsg_set_msg(e, "info", info);
htsmsg_set_s64(e, "start", gclk());
} else {
htsmsg_destroy(info);
}
Expand Down Expand Up @@ -1571,6 +1572,8 @@ static void
dvr_thread_epilog(dvr_entry_t *de, const char *dvr_postproc)
{
profile_chain_t *prch = de->de_chain;
htsmsg_t *e;
htsmsg_field_t *f;

if (prch == NULL)
return;
Expand All @@ -1579,6 +1582,12 @@ dvr_thread_epilog(dvr_entry_t *de, const char *dvr_postproc)
muxer_destroy(prch->prch_muxer);
prch->prch_muxer = NULL;

if ((f = htsmsg_field_last(de->de_files)) != NULL &&
(e = htsmsg_field_get_map(f)) != NULL)
htsmsg_set_s64(e, "stop", gclk());

if(dvr_postproc && dvr_postproc[0])
dvr_spawn_cmd(de, dvr_postproc, NULL, 0);

idnode_changed(&de->de_id);
}

0 comments on commit 3944bd1

Please sign in to comment.