From: Jaroslav Kysela Date: Mon, 30 Nov 2015 12:32:07 +0000 (+0100) Subject: subscriptions: add SM_CODE_NO_ADAPTERS, fixes #3358 X-Git-Tag: v4.2.1~1445 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00eff4b240716d4ceac0a3a871f3094600ac0301;p=thirdparty%2Ftvheadend.git subscriptions: add SM_CODE_NO_ADAPTERS, fixes #3358 --- diff --git a/src/epggrab/otamux.c b/src/epggrab/otamux.c index ae813166e..916cc3f6c 100644 --- a/src/epggrab/otamux.c +++ b/src/epggrab/otamux.c @@ -556,10 +556,14 @@ next_one: SUBSCRIPTION_EPG | SUBSCRIPTION_ONESHOT | SUBSCRIPTION_TABLES))) { - TAILQ_INSERT_TAIL(&epggrab_ota_pending, om, om_q_link); - om->om_q_type = EPGGRAB_OTA_MUX_PENDING; - if (r == SM_CODE_NO_FREE_ADAPTER) + if (r != SM_CODE_NO_ADAPTERS) { + TAILQ_INSERT_TAIL(&epggrab_ota_pending, om, om_q_link); + om->om_q_type = EPGGRAB_OTA_MUX_PENDING; + if (r == SM_CODE_NO_FREE_ADAPTER) + net->failed = 1; + } else { net->failed = 1; + } if (first == NULL) first = om; } else { diff --git a/src/htsp_server.c b/src/htsp_server.c index 7fdf1e10c..a54767263 100644 --- a/src/htsp_server.c +++ b/src/htsp_server.c @@ -3872,6 +3872,7 @@ _htsp_get_subscription_status(int smcode) { case SM_CODE_NOT_FREE: case SM_CODE_NO_FREE_ADAPTER: + case SM_CODE_NO_ADAPTERS: return "noFreeAdapter"; case SM_CODE_NO_DESCRAMBLER: return "scrambled"; diff --git a/src/input/mpegts/mpegts_network_scan.c b/src/input/mpegts/mpegts_network_scan.c index fdb9dd072..5e05bac4f 100644 --- a/src/input/mpegts/mpegts_network_scan.c +++ b/src/input/mpegts/mpegts_network_scan.c @@ -66,7 +66,7 @@ mpegts_network_scan_timer_cb ( void *p ) assert(mm->mm_scan_state == MM_SCAN_STATE_PEND); /* No free tuners - stop */ - if (r == SM_CODE_NO_FREE_ADAPTER) + if (r == SM_CODE_NO_FREE_ADAPTER || r == SM_CODE_NO_ADAPTERS) break; /* No valid tuners (subtly different, might be able to tuner a later diff --git a/src/service.c b/src/service.c index b2a230e76..eead9cf5e 100644 --- a/src/service.c +++ b/src/service.c @@ -706,6 +706,12 @@ service_find_instance service_instance_destroy(sil, si); } + if (TAILQ_EMPTY(sil)) { + if (*error < SM_CODE_NO_ADAPTERS) + *error = SM_CODE_NO_ADAPTERS; + return NULL; + } + /* Debug */ TAILQ_FOREACH(si, sil, si_link) { const char *name = ch ? channel_get_name(ch) : NULL; diff --git a/src/streaming.c b/src/streaming.c index 6b86640ad..b6c5cadd9 100644 --- a/src/streaming.c +++ b/src/streaming.c @@ -441,6 +441,8 @@ streaming_code2txt(int code) return N_("No source available"); case SM_CODE_NO_SERVICE: return N_("No service assigned to channel"); + case SM_CODE_NO_ADAPTERS: + return N_("No assigned adapters"); case SM_CODE_ABORTED: return N_("Aborted by user"); diff --git a/src/tvheadend.h b/src/tvheadend.h index e9acd6544..14f406440 100644 --- a/src/tvheadend.h +++ b/src/tvheadend.h @@ -467,6 +467,7 @@ typedef enum { #define SM_CODE_NO_SOURCE 206 #define SM_CODE_NO_SERVICE 207 #define SM_CODE_NO_VALID_ADAPTER 208 +#define SM_CODE_NO_ADAPTERS 209 #define SM_CODE_ABORTED 300