]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
mpegts: pid subscription - fix wrong mps_type mpegts_mps_cmp(), fixes #5492
authorJaroslav Kysela <perex@perex.cz>
Thu, 14 Feb 2019 12:38:50 +0000 (13:38 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 14 Feb 2019 15:52:10 +0000 (16:52 +0100)
src/input/mpegts/mpegts_input.c

index db467283a5de5dd9c552fdff61be5f3408a1abdd..e7e1846e8f4e7d09478882050cdc3b80641d51f0 100644 (file)
@@ -472,12 +472,9 @@ mpegts_input_stop_mux ( mpegts_input_t *mi, mpegts_mux_instance_t *mmi )
 int
 mpegts_mps_cmp ( mpegts_pid_sub_t *a, mpegts_pid_sub_t *b )
 {
-  if (a->mps_type != b->mps_type) {
-    if (a->mps_type & MPS_SERVICE)
-      return 1;
-    else
-      return -1;
-  }
+  const int mask = MPS_SERVICE;
+  if ((a->mps_type & mask) != (b->mps_type & mask)) {
+    return (a->mps_type & mask) ? 1 : -1;
   if (a->mps_owner < b->mps_owner) return -1;
   if (a->mps_owner > b->mps_owner) return 1;
   return 0;