Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SAT>IP client: add --nosatip option
  • Loading branch information
perexg committed Oct 9, 2015
1 parent 81b887e commit 69bc9b6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/input/mpegts.c
Expand Up @@ -20,7 +20,7 @@
#include "mpegts/fastscan.h"

void
mpegts_init ( int linuxdvb_mask, str_list_t *satip_client,
mpegts_init ( int linuxdvb_mask, int nosatip, str_list_t *satip_client,
str_list_t *tsfiles, int tstuners )
{
/* Register classes (avoid API 400 errors due to not yet defined) */
Expand Down Expand Up @@ -63,7 +63,7 @@ mpegts_init ( int linuxdvb_mask, str_list_t *satip_client,

/* SAT>IP DVB client */
#if ENABLE_SATIP_CLIENT
satip_init(satip_client);
satip_init(nosatip, satip_client);
#endif

/* HDHomerun client */
Expand Down
2 changes: 1 addition & 1 deletion src/input/mpegts.h
Expand Up @@ -70,7 +70,7 @@ extern const idclass_t mpegts_input_class;
* Setup / Tear down
* *************************************************************************/

void mpegts_init ( int linuxdvb_mask, str_list_t *satip_client,
void mpegts_init ( int linuxdvb_mask, int nosatip, str_list_t *satip_client,
str_list_t *tsfiles, int tstuners );
void mpegts_done ( void );

Expand Down
12 changes: 9 additions & 3 deletions src/input/mpegts/satip/satip.c
Expand Up @@ -737,6 +737,7 @@ typedef struct satip_discovery {

TAILQ_HEAD(satip_discovery_queue, satip_discovery);

static int satip_enabled;
static int satip_discoveries_count;
static struct satip_discovery_queue satip_discoveries;
static upnp_service_t *satip_discovery_service;
Expand Down Expand Up @@ -1199,6 +1200,8 @@ satip_discovery_timer_cb(void *aux)
void
satip_device_discovery_start( void )
{
if (!satip_enabled)
return;
gtimer_arm(&satip_discovery_timer, satip_discovery_timer_cb, NULL, 1);
gtimer_arm(&satip_discovery_static_timer, satip_discovery_static_timer_cb, NULL, 1);
}
Expand All @@ -1207,12 +1210,15 @@ satip_device_discovery_start( void )
* Initialization
*/

void satip_init ( str_list_t *clients )
void satip_init ( int nosatip, str_list_t *clients )
{
satip_enabled = !nosatip;
TAILQ_INIT(&satip_discoveries);
satip_static_clients = clients;
dbus_register_rpc_str("satip_addr", NULL, satip_device_addr);
satip_device_discovery_start();
if (satip_enabled) {
dbus_register_rpc_str("satip_addr", NULL, satip_device_addr);
satip_device_discovery_start();
}
}

void satip_done ( void )
Expand Down
2 changes: 1 addition & 1 deletion src/input/mpegts/satip/satip.h
Expand Up @@ -22,7 +22,7 @@

void satip_device_discovery_start( void );

void satip_init( str_list_t *clients );
void satip_init( int nosatip, str_list_t *clients );
void satip_done( void );

#endif /* __TVH_SATIP_H__ */
8 changes: 6 additions & 2 deletions src/main.c
Expand Up @@ -630,6 +630,7 @@ main(int argc, char **argv)
opt_threadid = 0,
opt_libav = 0,
opt_ipv6 = 0,
opt_nosatip = 0,
opt_satip_rtsp = 0,
#if ENABLE_TSFILE
opt_tsfile_tuner = 0,
Expand Down Expand Up @@ -689,7 +690,9 @@ main(int argc, char **argv)
OPT_INT, &opt_satip_rtsp },
#endif
#if ENABLE_SATIP_CLIENT
{ 0, "satip_xml", N_("URL with the SAT>IP server XML location"),
{ 0, "nosatip", N_("Disable SAT>IP client"),
OPT_BOOL, &opt_nosatip },
{ 0, "satip_xml", N_("URL with the SAT>IP server XML location"),
OPT_STR_LIST, &opt_satip_xml },
#endif
{ 0, NULL, N_("Server Connectivity"), OPT_BOOL, NULL },
Expand Down Expand Up @@ -1026,7 +1029,8 @@ main(int argc, char **argv)
dvb_init();

#if ENABLE_MPEGTS
mpegts_init(adapter_mask, &opt_satip_xml, &opt_tsfile, opt_tsfile_tuner);
mpegts_init(adapter_mask, opt_nosatip, &opt_satip_xml,
&opt_tsfile, opt_tsfile_tuner);
#endif

channel_init();
Expand Down

0 comments on commit 69bc9b6

Please sign in to comment.