]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
added tags for errors (%r) and data errors (%R) in DVR post-processing command-line
authorMario Di Raimondo <mario.diraimondo@gmail.com>
Sun, 11 Oct 2015 15:55:18 +0000 (17:55 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sun, 11 Oct 2015 19:37:09 +0000 (21:37 +0200)
src/dvr/dvr_rec.c

index 77b5f95e67ce23cc385df7a26ba28adaba1a969b..35c71611edd3895e9ca3b1bf9fdb16aa7345727b 100644 (file)
@@ -366,6 +366,22 @@ dvr_sub_start(const char *id, const void *aux, char *tmp, size_t tmplen)
   return dvr_do_prefix(id, buf, tmp, tmplen);
 }
 
+static const char *
+dvr_sub_errors(const char *id, const void *aux, char *tmp, size_t tmplen)
+{
+  char buf[16];
+  snprintf(buf, sizeof(buf), "%"PRIu32, (uint32_t)((dvr_entry_t *)aux)->de_errors);
+  return dvr_do_prefix(id, buf, tmp, tmplen);
+}
+
+static const char *
+dvr_sub_data_errors(const char *id, const void *aux, char *tmp, size_t tmplen)
+{
+  char buf[16];
+  snprintf(buf, sizeof(buf), "%"PRIu32, (uint32_t)((dvr_entry_t *)aux)->de_data_errors);
+  return dvr_do_prefix(id, buf, tmp, tmplen);
+}
+
 static const char *
 dvr_sub_stop(const char *id, const void *aux, char *tmp, size_t tmplen)
 {
@@ -518,6 +534,8 @@ static htsstr_substitute_t dvr_subs_postproc_entry[] = {
   { .id = "O",  .getval = dvr_sub_owner },
   { .id = "S",  .getval = dvr_sub_start },
   { .id = "E",  .getval = dvr_sub_stop },
+  { .id = "r",  .getval = dvr_sub_errors },
+  { .id = "R",  .getval = dvr_sub_data_errors },
   { .id = NULL, .getval = NULL }
 };