From: Jaroslav Kysela Date: Wed, 17 May 2017 19:17:42 +0000 (+0200) Subject: DVR: allow to pass comment %Z in pre/post processor commands, fixes #4356 X-Git-Tag: v4.2.3~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b407b33a85463980720a448ba3fca65ecde0608b;p=thirdparty%2Ftvheadend.git DVR: allow to pass comment %Z in pre/post processor commands, fixes #4356 --- diff --git a/docs/property/postprocessor.md b/docs/property/postprocessor.md index b5668dcce..e41621081 100644 --- a/docs/property/postprocessor.md +++ b/docs/property/postprocessor.md @@ -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* diff --git a/docs/property/preprocessor.md b/docs/property/preprocessor.md index f2da6bc60..13463944f 100644 --- a/docs/property/preprocessor.md +++ b/docs/property/preprocessor.md @@ -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* diff --git a/src/dvr/dvr_rec.c b/src/dvr/dvr_rec.c index e126c8027..2804a042b 100644 --- a/src/dvr/dvr_rec.c +++ b/src/dvr/dvr_rec.c @@ -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 } };