]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
DVR: allow to pass comment %Z in pre/post processor commands, fixes #4356
authorJaroslav Kysela <perex@perex.cz>
Wed, 17 May 2017 19:17:42 +0000 (21:17 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 22 May 2017 12:02:51 +0000 (14:02 +0200)
docs/property/postprocessor.md
docs/property/preprocessor.md
src/dvr/dvr_rec.c

index b5668dcceacfa76e9c3133c8d37a26e376f99d1b..e41621081c4f75f6ed16df5a5434b70d02777749 100644 (file)
@@ -24,6 +24,7 @@ Format | Description                               | Example value
 `%r`   | Number of errors during recording         |  0
 `%R`   | Number of data errors during recording    |  6
 `%i`   | Streams (comma separated)                 |  H264,AC3,TELETEXT
+`%Z`   | Comment                                   |  A string
 
 *Example usage*
 
index f2da6bc60cfcf68b0aac96f4471eb644c1e041df..13463944f53273739bd83e2c14f52affc9718aa7 100644 (file)
@@ -17,6 +17,7 @@ Format | Description                               | Example value
 `%d`   | Program description                       |  News and stories…
 `%S`   | Start time stamp of recording, UNIX epoch |  1224421200
 `%E`   | Stop time stamp of recording, UNIX epoch  |  1224426600
+`%Z`   | Comment                                   |  A string
 
 *Example usage*
 
index e126c8027a41a53a2ea13e328e1f9e395a8bd0de..2804a042b6d61809c95276ac18815274c353de1f 100644 (file)
@@ -425,6 +425,12 @@ dvr_sub_stop(const char *id, const char *fmt, const void *aux, char *tmp, size_t
   return dvr_do_prefix(id, fmt, buf, tmp, tmplen);
 }
 
+static const char *
+dvr_sub_comment(const char *id, const char *fmt, const void *aux, char *tmp, size_t tmplen)
+{
+  return dvr_do_prefix(id, fmt, ((dvr_entry_t *)aux)->de_comment, tmp, tmplen);
+}
+
 static htsstr_substitute_t dvr_subs_entry[] = {
   { .id = "?t",  .getval = dvr_sub_title },
   { .id = "? t", .getval = dvr_sub_title },
@@ -579,6 +585,7 @@ static htsstr_substitute_t dvr_subs_postproc_entry[] = {
   { .id = "E",  .getval = dvr_sub_stop },
   { .id = "r",  .getval = dvr_sub_errors },
   { .id = "R",  .getval = dvr_sub_data_errors },
+  { .id = "Z",  .getval = dvr_sub_comment },
   { .id = NULL, .getval = NULL }
 };