diff options
author | David Teirney <david@teirney.net> | 2012-07-02 21:37:58 +1200 |
---|---|---|
committer | David Teirney <david@teirney.net> | 2012-07-09 23:34:55 +1200 |
commit | 9ee7a18f8d98d48d99d5a8d0c7d987f80f1c9a88 (patch) | |
tree | a89be1790e6950f08e796e374251e3f8cbb2ac8d /lib | |
parent | b8749674670a81f6302e427843fad3dc61fe94d5 (diff) |
[libcmyth] Rename proginfo_prodyear to proginfo_year and change type to match upstream and mythbackend.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cmyth/Win32/libcmyth.def | 2 | ||||
-rw-r--r-- | lib/cmyth/include/cmyth/cmyth.h | 4 | ||||
-rw-r--r-- | lib/cmyth/libcmyth/cmyth_local.h | 2 | ||||
-rw-r--r-- | lib/cmyth/libcmyth/proginfo.c | 37 | ||||
-rw-r--r-- | lib/cmyth/libcmyth/socket.c | 23 |
5 files changed, 29 insertions, 39 deletions
diff --git a/lib/cmyth/Win32/libcmyth.def b/lib/cmyth/Win32/libcmyth.def index 47c14494ca..599bc4b610 100644 --- a/lib/cmyth/Win32/libcmyth.def +++ b/lib/cmyth/Win32/libcmyth.def @@ -137,7 +137,7 @@ EXPORTS cmyth_proginfo_host cmyth_proginfo_card_id cmyth_proginfo_recgroup - cmyth_proginfo_prodyear + cmyth_proginfo_year cmyth_get_delete_list cmyth_proglist_create cmyth_proglist_get_item diff --git a/lib/cmyth/include/cmyth/cmyth.h b/lib/cmyth/include/cmyth/cmyth.h index cba88146be..fae6889069 100644 --- a/lib/cmyth/include/cmyth/cmyth.h +++ b/lib/cmyth/include/cmyth/cmyth.h @@ -965,9 +965,9 @@ extern char *cmyth_proginfo_chanicon(cmyth_proginfo_t prog); /** * Retrieve the production year for this program info * \param prog proginfo handle - * \return null-terminated string + * \return production year */ -extern char *cmyth_proginfo_prodyear(cmyth_proginfo_t prog); +extern unsigned short cmyth_proginfo_year(cmyth_proginfo_t prog); /* * ----------------------------------------------------------------- diff --git a/lib/cmyth/libcmyth/cmyth_local.h b/lib/cmyth/libcmyth/cmyth_local.h index ef8fa8feed..a7e535901d 100644 --- a/lib/cmyth/libcmyth/cmyth_local.h +++ b/lib/cmyth/libcmyth/cmyth_local.h @@ -256,7 +256,7 @@ struct cmyth_proginfo { unsigned long proginfo_audioproperties; /* new in v35 */ unsigned long proginfo_videoproperties; /* new in v35 */ unsigned long proginfo_subtitletype; /* new in v35 */ - char *proginfo_prodyear; /* new in v41 */ + unsigned short proginfo_year; /* new in v43 */ }; struct cmyth_proglist { diff --git a/lib/cmyth/libcmyth/proginfo.c b/lib/cmyth/libcmyth/proginfo.c index 48e4b95ad4..fa9db29fa1 100644 --- a/lib/cmyth/libcmyth/proginfo.c +++ b/lib/cmyth/libcmyth/proginfo.c @@ -151,9 +151,6 @@ cmyth_proginfo_destroy(cmyth_proginfo_t p) if (p->proginfo_recpriority_2) { ref_release(p->proginfo_recpriority_2); } - if (p->proginfo_prodyear) { - ref_release(p->proginfo_prodyear); - } cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__); } @@ -265,7 +262,7 @@ cmyth_proginfo_create(void) ret->proginfo_audioproperties = 0; ret->proginfo_videoproperties = 0; ret->proginfo_subtitletype = 0; - ret->proginfo_prodyear = NULL; + ret->proginfo_year = 0; cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__); return ret; @@ -358,7 +355,7 @@ cmyth_proginfo_dup(cmyth_proginfo_t p) ret->proginfo_audioproperties = p->proginfo_audioproperties; ret->proginfo_videoproperties = p->proginfo_videoproperties; ret->proginfo_subtitletype = p->proginfo_subtitletype; - ret->proginfo_prodyear = ref_hold(p->proginfo_prodyear); + ret->proginfo_year = p->proginfo_year; cmyth_dbg(CMYTH_DBG_DEBUG, "%s }\n", __FUNCTION__); return ret; } @@ -428,7 +425,6 @@ delete_command(cmyth_conn_t control, cmyth_proginfo_t prog, char *cmd) len += strlen(S(prog->proginfo_inetref)); len += strlen(S(prog->proginfo_recpriority_2)); len += strlen(S(prog->proginfo_storagegroup)); - len += strlen(S(prog->proginfo_prodyear)); buf = alloca(len + 1+2048); if (!buf) { @@ -546,8 +542,8 @@ delete_command(cmyth_conn_t control, cmyth_proginfo_t prog, char *cmd) sprintf(buf + strlen(buf), "%ld[]:[]", prog->proginfo_videoproperties); sprintf(buf + strlen(buf), "%ld[]:[]", prog->proginfo_subtitletype); } - if (control->conn_version >= 41) { - sprintf(buf + strlen(buf), "%s[]:[]", S(prog->proginfo_prodyear)); + if (control->conn_version >= 43) { + sprintf(buf + strlen(buf), "%d[]:[]", prog->proginfo_year); } #undef S @@ -1272,33 +1268,29 @@ cmyth_proginfo_flags(cmyth_proginfo_t prog) } /* - * cmyth_proginfo_prodyear(cmyth_proginfo_t prog) + * cmyth_proginfo_year(cmyth_proginfo_t prog) * * * Scope: PUBLIC * * Description * - * Retrieves the 'proginfo_prodyear' field of a program info + * Retrieves the 'proginfo_year' field of a program info * structure. * - * The returned string is a pointer to the string within the program - * info structure, so it should not be modified by the caller. The - * return value is a 'char *' for this reason. - * * Return Value: * - * Success: A pointer to a 'char *' pointing to the field. + * Success: the production year for the program * - * Failure: NULL + * Failure: 0 */ -char * -cmyth_proginfo_prodyear(cmyth_proginfo_t prog) +unsigned short +cmyth_proginfo_year(cmyth_proginfo_t prog) { if (!prog) { - return NULL; + return 0; } - return ref_hold(prog->proginfo_prodyear); + return prog->proginfo_year; } static int @@ -1340,7 +1332,6 @@ fill_command(cmyth_conn_t control, cmyth_proginfo_t prog, char *cmd) len += strlen(S(prog->proginfo_inetref)); len += strlen(S(prog->proginfo_recpriority_2)); len += strlen(S(prog->proginfo_storagegroup)); - len += strlen(S(prog->proginfo_prodyear)); buf = alloca(len + 1+2048); if (!buf) { @@ -1458,8 +1449,8 @@ fill_command(cmyth_conn_t control, cmyth_proginfo_t prog, char *cmd) sprintf(buf + strlen(buf), "%ld[]:[]", prog->proginfo_videoproperties); sprintf(buf + strlen(buf), "%ld[]:[]", prog->proginfo_subtitletype); } - if (control->conn_version >= 41) { - sprintf(buf + strlen(buf), "%s[]:[]", S(prog->proginfo_prodyear)); + if (control->conn_version >= 43) { + sprintf(buf + strlen(buf), "%d[]:[]", prog->proginfo_year); } #undef S diff --git a/lib/cmyth/libcmyth/socket.c b/lib/cmyth/libcmyth/socket.c index 096a8e0ae9..4340f2ea78 100644 --- a/lib/cmyth/libcmyth/socket.c +++ b/lib/cmyth/libcmyth/socket.c @@ -2345,23 +2345,22 @@ cmyth_rcv_proginfo(cmyth_conn_t conn, int *err, cmyth_proginfo_t buf, failed = "cmyth_rcv_ulong subtitletype"; goto fail; } - } - if (buf->proginfo_version >= 41) { - /* - * Get proginfo_prodyear (string) - */ - consumed = cmyth_rcv_string(conn, err, - tmp_str, sizeof(tmp_str) - 1, count); + } + + /* + * Get Year + */ + if (buf->proginfo_version >= 43) { + consumed = cmyth_rcv_ushort(conn, err, &buf->proginfo_year, + count); count -= consumed; total += consumed; if (*err) { - failed = "cmyth_rcv_string"; + failed = "cmyth_rcv_ushort proginfo_year"; goto fail; } - if (buf->proginfo_prodyear) - ref_release(buf->proginfo_prodyear); - buf->proginfo_prodyear = ref_strdup(tmp_str); - } + } + cmyth_dbg(CMYTH_DBG_INFO, "%s: got recording info\n", __FUNCTION__); cmyth_proginfo_parse_url(buf); |