From: Jaroslav Kysela Date: Thu, 14 Feb 2019 12:38:50 +0000 (+0100) Subject: mpegts: pid subscription - fix wrong mps_type mpegts_mps_cmp(), fixes #5492 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57b766ab7e8ab3dbec2476cc269eaf8101d48b64;p=thirdparty%2Ftvheadend.git mpegts: pid subscription - fix wrong mps_type mpegts_mps_cmp(), fixes #5492 --- diff --git a/src/input/mpegts/mpegts_input.c b/src/input/mpegts/mpegts_input.c index cef26f00e..df5ab18c7 100644 --- a/src/input/mpegts/mpegts_input.c +++ b/src/input/mpegts/mpegts_input.c @@ -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;