From 8cb73de479310ac3da837ab2d1adc6b80d0ec81b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Sat, 11 Aug 2007 05:37:56 +0000 Subject: [PATCH] Fix 'ENABLE_INPUT_' defines --- Makefile | 2 +- channels.c | 27 +++++++++++++++------------ input_iptv.c | 2 ++ transports.c | 15 ++++++++------- 4 files changed, 26 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index e59765a3..eedba790 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ CFLAGS += -g -Wall -Werror -O2 CFLAGS += -I$(CURDIR)/../install/include CFLAGS += -Wno-deprecated-declarations CFLAGS += -D_LARGEFILE64_SOURCE - +CFLAGS += -DENABLE_INPUT_IPTV -DENABLE_INPUT_DVB LDFLAGS += -L$(CURDIR)/../install/lib DLIBS += -lhts diff --git a/channels.c b/channels.c index c73a588a..35daa6db 100644 --- a/channels.c +++ b/channels.c @@ -84,7 +84,7 @@ transportcmp(th_transport_t *a, th_transport_t *b) static void service_load(struct config_head *head) { - const char *name, *v, *mux; + const char *name, *v; pidinfo_t pids[10]; int i, npids = 0; th_transport_t *t; @@ -98,21 +98,24 @@ service_load(struct config_head *head) t = calloc(1, sizeof(th_transport_t)); - if((mux = config_get_str_sub(head, "dvbmux", NULL)) != NULL) { - if(dvb_configure_transport(t, mux)) { - free(t); - return; - } -#ifdef HAVE_IPTV - } else if((mux = config_get_str_sub(head, "iptvmux", NULL)) != NULL) { - if(iptv_configure_transport(t, mux)) { + if(0) { +#ifdef ENABLE_INPUT_DVB + } else if((v = config_get_str_sub(head, "dvbmux", NULL)) != NULL) { + if(dvb_configure_transport(t, v)) { free(t); return; } #endif -#ifdef HAVE_V4L - } else if((mux = config_get_str_sub(head, "v4lmux", NULL)) != NULL) { - if(v4l_configure_transport(t, mux)) { +#ifdef ENABLE_INPUT_IPTV + } else if((v = config_get_str_sub(head, "iptvmux", NULL)) != NULL) { + if(iptv_configure_transport(t, v)) { + free(t); + return; + } +#endif +#ifdef ENABLE_INPUT_V4L + } else if((v = config_get_str_sub(head, "v4lmux", NULL)) != NULL) { + if(v4l_configure_transport(t, v)) { free(t); return; } diff --git a/input_iptv.c b/input_iptv.c index 85c6ea15..b84eae0f 100644 --- a/input_iptv.c +++ b/input_iptv.c @@ -133,6 +133,8 @@ iptv_configure_transport(th_transport_t *t, const char *muxname) if((ce = find_mux_config("iptvmux", muxname)) == NULL) return -1; + printf("Added IPTV mux\n"); + t->tht_type = TRANSPORT_IPTV; if((s = config_get_str_sub(&ce->ce_sub, "group-address", NULL)) == NULL) diff --git a/transports.c b/transports.c index 316dfa69..9f2dce07 100644 --- a/transports.c +++ b/transports.c @@ -76,17 +76,17 @@ transport_purge(th_transport_t *t) return; switch(t->tht_type) { +#ifdef ENABLE_INPUT_DVB case TRANSPORT_DVB: dvb_stop_feed(t); break; - -#ifdef ENABLE_IPTV +#endif +#ifdef ENABLE_INPUT_IPTV case TRANSPORT_IPTV: iptv_stop_feed(t); break; #endif - -#ifdef ENABLE_V4L +#ifdef ENABLE_INPUT_V4L case TRANSPORT_V4L: v4l_stop_feed(t); break; @@ -107,14 +107,15 @@ transport_start(th_transport_t *t, unsigned int weight) t->tht_monitor_suspend = 10; switch(t->tht_type) { +#ifdef ENABLE_INPUT_DVB case TRANSPORT_DVB: return dvb_start_feed(t, weight); -#ifdef ENABLE_IPTV +#endif +#ifdef ENABLE_INPUT_IPTV case TRANSPORT_IPTV: return iptv_start_feed(t, weight); #endif - -#ifdef ENABLE_V4L +#ifdef ENABLE_INPUT_V4L case TRANSPORT_V4L: return v4l_start_feed(t, weight); #endif