From: Glenn-1990 Date: Sun, 18 Dec 2016 17:18:32 +0000 (+0100) Subject: don't pass channels without assigned services X-Git-Tag: v4.2.1~148 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e73a8b455a5e2449281f66f6816fef0891c2cc6e;p=thirdparty%2Ftvheadend.git don't pass channels without assigned services --- diff --git a/src/htsp_server.c b/src/htsp_server.c index 2f6274e74..848200378 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -521,6 +521,10 @@ htsp_generate_challenge(htsp_connection_t *htsp) static inline int htsp_user_access_channel(htsp_connection_t *htsp, channel_t *ch) { + if (!ch || !ch->ch_enabled || LIST_FIRST(&ch->ch_services) == NULL) /* Don't pass unplayable channels to clients */ + return 0; + if (!htsp) + return 1; return channel_access(ch, htsp->htsp_granted_access, 0); } @@ -3481,7 +3485,7 @@ htsp_channel_add(channel_t *ch) void htsp_channel_update(channel_t *ch) { - if (ch->ch_enabled) + if (htsp_user_access_channel(NULL, ch)) _htsp_channel_update(ch, "channelUpdate", NULL); else // in case the channel was ever sent to the client htsp_channel_delete(ch);