Issue #1446 - fix --disable-linuxdvb.

This commit is contained in:
Adam Sutton 2012-12-19 22:27:04 +00:00
parent d9dae65bbb
commit b624851dde
6 changed files with 32 additions and 7 deletions

View file

@ -106,16 +106,16 @@ SRCS = src/main.c \
src/avc.c \
src/huffman.c \
src/filebundle.c \
src/muxes.c \
src/config2.c \
src/lang_codes.c \
src/lang_str.c \
SRCS += src/epggrab/module.c\
src/epggrab/channel.c\
src/epggrab/otamux.c\
src/epggrab/module/pyepg.c\
src/epggrab/module/xmltv.c\
SRCS-$(CONFIG_LINUXDVB) += src/epggrab/otamux.c\
src/epggrab/module/eit.c \
src/epggrab/module/opentv.c \
src/epggrab/support/freesat_huffman.c \
@ -160,6 +160,7 @@ SRCS-${CONFIG_LINUXDVB} += \
src/dvb/dvb_input_filtered.c \
src/dvb/dvb_input_raw.c \
src/webui/extjs_dvb.c \
src/muxes.c \
# V4L
SRCS-${CONFIG_V4L} += \

View file

@ -572,7 +572,6 @@ capmt_thread(void *aux)
capmt_t *capmt = aux;
struct timespec ts;
int d, i, bind_ok = 0;
th_dvb_adapter_t *tda;
while (capmt->capmt_running) {
for (i = 0; i < MAX_CA; i++)
@ -605,6 +604,8 @@ capmt_thread(void *aux)
if (!capmt->capmt_oscam) {
bind_ok = capmt_create_udp_socket(&capmt->capmt_sock_ca0[0], capmt->capmt_port);
} else {
#if ENABLE_LINUXDVB
th_dvb_adapter_t *tda;
TAILQ_FOREACH(tda, &dvb_adapters, tda_global_link) {
if (tda->tda_rootpath) { //if rootpath is NULL then can't rely on tda_adapter_num because it is always 0
if (tda->tda_adapter_num > MAX_CA) {
@ -615,6 +616,7 @@ capmt_thread(void *aux)
bind_ok = capmt_create_udp_socket(&capmt->capmt_sock_ca0[tda->tda_adapter_num], 9000 + tda->tda_adapter_num);
}
}
#endif
}
if (bind_ok)
handle_ca0(capmt);

View file

@ -213,8 +213,10 @@ static void _epggrab_load ( void )
}
/* Load module config (channels) */
#if ENABLE_LINUXDVB
eit_load();
opentv_load();
#endif
pyepg_load();
xmltv_load();
}
@ -343,21 +345,27 @@ void epggrab_resched ( void )
void epggrab_init ( void )
{
/* Lists */
#if ENABLE_LINUXDVB
extern TAILQ_HEAD(, epggrab_ota_mux) ota_mux_all;
TAILQ_INIT(&ota_mux_all);
#endif
pthread_mutex_init(&epggrab_mutex, NULL);
pthread_cond_init(&epggrab_cond, NULL);
/* Initialise modules */
#if ENABLE_LINUXDVB
eit_init();
opentv_init();
#endif
pyepg_init();
xmltv_init();
/* Load config */
_epggrab_load();
#if ENABLE_LINUXDVB
epggrab_ota_load();
#endif
/* Start internal grab thread */
pthread_t tid;

View file

@ -275,7 +275,9 @@ main(int argc, char **argv)
sigset_t set;
const char *homedir;
const char *rawts_input = NULL;
#if ENABLE_LINUXDVB
const char *dvb_rawts_input = NULL;
#endif
const char *join_transport = NULL;
const char *confpath = NULL;
char *p, *endp;
@ -356,9 +358,11 @@ main(int argc, char **argv)
case 'r':
rawts_input = optarg;
break;
#if ENABLE_LINUXDVB
case 'R':
dvb_rawts_input = optarg;
break;
#endif
case 'j':
join_transport = optarg;
break;
@ -446,8 +450,6 @@ main(int argc, char **argv)
config_init();
muxes_init();
service_init();
channels_init();
@ -456,16 +458,19 @@ main(int argc, char **argv)
access_init(createdefault);
tcp_server_init();
#if ENABLE_LINUXDVB
muxes_init();
dvb_init(adapter_mask, dvb_rawts_input);
#endif
iptv_input_init();
#if ENABLE_V4L
v4l_init();
#endif
http_server_init();
tcp_server_init();
http_server_init();
webui_init();
serviceprobe_init();

View file

@ -29,6 +29,7 @@
#include "access.h"
#include "epg.h"
#include "psi.h"
#include "channels.h"
#if ENABLE_LINUXDVB
#include "dvr/dvr.h"
#include "dvb/dvb.h"

View file

@ -597,6 +597,7 @@ http_stream_service(http_connection_t *hc, service_t *service)
/**
* Subscribes to a service and starts the streaming loop
*/
#if ENABLE_LINUXDVB
static int
http_stream_tdmi(http_connection_t *hc, th_dvb_mux_instance_t *tdmi)
{
@ -616,6 +617,7 @@ http_stream_tdmi(http_connection_t *hc, th_dvb_mux_instance_t *tdmi)
return 0;
}
#endif
/**
@ -698,7 +700,9 @@ http_stream(http_connection_t *hc, const char *remain, void *opaque)
char *components[2];
channel_t *ch = NULL;
service_t *service = NULL;
#if ENABLE_LINUXDVB
th_dvb_mux_instance_t *tdmi = NULL;
#endif
hc->hc_keep_alive = 0;
@ -722,16 +726,20 @@ http_stream(http_connection_t *hc, const char *remain, void *opaque)
ch = channel_find_by_name(components[1], 0, 0);
} else if(!strcmp(components[0], "service")) {
service = service_find_by_identifier(components[1]);
#if ENABLE_LINUXDVB
} else if(!strcmp(components[0], "mux")) {
tdmi = dvb_mux_find_by_identifier(components[1]);
#endif
}
if(ch != NULL) {
return http_stream_channel(hc, ch);
} else if(service != NULL) {
return http_stream_service(hc, service);
#if ENABLE_LINUXDVB
} else if(tdmi != NULL) {
return http_stream_tdmi(hc, tdmi);
#endif
} else {
http_error(hc, HTTP_STATUS_BAD_REQUEST);
return HTTP_STATUS_BAD_REQUEST;