]> 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 12:38:50 +0000 (13:38 +0100)
src/input/mpegts/mpegts_input.c

index cef26f00e6c25ea953e033057153a8aba4782509..df5ab18c7ac7aea133302968cefb49634975c9e7 100644 (file)
@@ -464,12 +464,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;