]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
DVR: handle the subscription priority/weight correctly, fixes #4429
authorJaroslav Kysela <perex@perex.cz>
Wed, 14 Jun 2017 06:09:35 +0000 (08:09 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 14 Jun 2017 06:09:35 +0000 (08:09 +0200)
src/dvr/dvr_rec.c

index 6802345a89b9ee0dc5cfaeb723df0d5c0de49a8e..3a289615a05f191e04fac32de16fc32875ab99fa 100644 (file)
@@ -77,10 +77,9 @@ dvr_rec_subscribe(dvr_entry_t *de)
   pri = de->de_pri;
   if(pri == DVR_PRIO_NOTSET || pri == DVR_PRIO_DEFAULT)
     pri = de->de_config->dvr_pri;
-  if(pri >= 0 && pri < ARRAY_SIZE(prio2weight))
-    weight = prio2weight[de->de_pri];
-  else
-    weight = prio2weight[DVR_PRIO_NORMAL];
+  if(pri < 0 || pri >= ARRAY_SIZE(prio2weight))
+    pri = DVR_PRIO_NORMAL;
+  weight = prio2weight[pri];
 
   snprintf(buf, sizeof(buf), "DVR: %s", lang_str_get(de->de_title, NULL));