]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
htsp server: try to play correctly with older htsp clients (DVR prio NOTSET), fixes...
authorJaroslav Kysela <perex@perex.cz>
Mon, 9 Oct 2017 14:45:30 +0000 (16:45 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 10 Nov 2017 07:55:50 +0000 (08:55 +0100)
src/dvr/dvr_rec.c
src/htsp_server.c

index e08307687c527d7bf22bd5169560e6f4c3061c2e..a08f198e7f68f29e1880f8789ab85d6f54d94fab 100644 (file)
@@ -53,7 +53,7 @@ const static int prio2weight[6] = {
   [DVR_PRIO_NORMAL]      = 300,
   [DVR_PRIO_LOW]         = 200,
   [DVR_PRIO_UNIMPORTANT] = 100,
-  [DVR_PRIO_NOTSET]      = 0,
+  [DVR_PRIO_NOTSET]      = 300, /* as DVR_PRIO_NORMAL */
 };
 
 /**
index 6105fb4edc14c3fc60dcf637dc15ed6d1b4cdbe1..0d84a3c318f696b352b38b16f439b6658b73557f 100644 (file)
@@ -933,6 +933,7 @@ htsp_build_dvrentry(htsp_connection_t *htsp, dvr_entry_t *de, const char *method
   const char *s = NULL, *error = NULL, *subscriptionError = NULL;
   const char *p, *last;
   int64_t fsize = -1;
+  uint32_t u32;
   char ubuf[UUID_HEX_SIZE];
 
   htsmsg_add_u32(out, "id", idnode_get_short_uuid(&de->de_id));
@@ -965,7 +966,10 @@ htsp_build_dvrentry(htsp_connection_t *htsp, dvr_entry_t *de, const char *method
           dvr_entry_get_removal_days(de) : dvr_entry_get_retention_days(de));
 
     htsmsg_add_u32(out, "removal",     dvr_entry_get_removal_days(de));
-    htsmsg_add_u32(out, "priority",    de->de_pri);
+    u32 = de->de_pri;
+    if (u32 >= DVR_PRIO_NOTSET)
+      u32 = DVR_PRIO_NORMAL;
+    htsmsg_add_u32(out, "priority",    u32);
     htsmsg_add_u32(out, "contentType", de->de_content_type);
 
     if (de->de_sched_state == DVR_RECORDING || de->de_sched_state == DVR_COMPLETED) {