From: Jaroslav Kysela Date: Wed, 6 May 2015 20:18:32 +0000 (+0200) Subject: SAT>IP Client: improve server detection - retrigger MSEARCH when a broadcast is recei... X-Git-Tag: v4.1~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cafbf1a83a54a5999e1f8a954b7cac3b8497d836;p=thirdparty%2Ftvheadend.git SAT>IP Client: improve server detection - retrigger MSEARCH when a broadcast is received, too --- diff --git a/src/input/mpegts/satip/satip.c b/src/input/mpegts/satip/satip.c index 7e67c789e..dd3d2a627 100644 --- a/src/input/mpegts/satip/satip.c +++ b/src/input/mpegts/satip/satip.c @@ -35,6 +35,8 @@ #include #endif +static void satip_discovery_timer_cb(void *aux); + /* * */ @@ -976,13 +978,13 @@ satip_discovery_service_received } /* Sanity checks */ if (st == NULL || strcmp(st, "urn:ses-com:device:SatIPServer:1")) - return; + goto add_uuid; if (uuid == NULL || strlen(uuid) < 16 || satip_server_match_uuid(uuid)) - return; + goto add_uuid; if (location == NULL || strncmp(location, "http://", 7)) - return; + goto add_uuid; if (bootid == NULL || configid == NULL || server == NULL) - return; + goto add_uuid; /* Forward information to next layer */ @@ -1015,6 +1017,16 @@ satip_discovery_service_received pthread_mutex_unlock(&global_lock); if (i) /* duplicate */ satip_discovery_destroy(d, 0); + return; + +add_uuid: + if (deviceid == NULL || uuid == NULL) + return; + /* if new uuid was discovered, retrigger MSEARCH */ + pthread_mutex_lock(&global_lock); + if (!satip_device_find(uuid)) + gtimer_arm(&satip_discovery_timer, satip_discovery_timer_cb, NULL, 5); + pthread_mutex_unlock(&global_lock); } static void