diff --git a/Makefile b/Makefile index 50c84d81..5d784f2d 100644 --- a/Makefile +++ b/Makefile @@ -66,7 +66,7 @@ PROG = tvheadend MAN = tvheadend.1 CFLAGS += -g -Wall -Werror -O2 -mmmx CFLAGS += -I$(INCLUDES_INSTALL_BASE) $(HTS_CFLAGS) -I$(CURDIR) -CFLAGS += -Wno-deprecated-declarations +CFLAGS += -Wno-deprecated-declarations -Wmissing-prototypes CFLAGS += -D_LARGEFILE64_SOURCE CFLAGS += -DENABLE_INPUT_IPTV -DENABLE_INPUT_DVB -DENABLE_INPUT_V4L LDFLAGS += -L$(LIBS_INSTALL_BASE) diff --git a/access.c b/access.c index 03fb9cb3..9199f9a8 100644 --- a/access.c +++ b/access.c @@ -66,7 +66,7 @@ access_alloc(void) /** * */ -access_entry_t * +static access_entry_t * access_add_network(const char *prefix) { access_entry_t *ae; @@ -112,7 +112,7 @@ access_add_network(const char *prefix) /** * */ -access_entry_t * +static access_entry_t * access_add_user(const char *username) { access_entry_t *ae; diff --git a/ajaxui/ajaxui_channels.c b/ajaxui/ajaxui_channels.c index bcd04e1d..4905629e 100644 --- a/ajaxui/ajaxui_channels.c +++ b/ajaxui/ajaxui_channels.c @@ -127,7 +127,7 @@ ajax_list_events(tcp_queue_t *tq, th_channel_t *ch, int lines) * * Group is given by 'tag' as an ASCII string in remain */ -int +static int ajax_channel_tab(http_connection_t *hc, http_reply_t *hr, const char *remain, void *opaque) { diff --git a/ajaxui/ajaxui_config_dvb.c b/ajaxui/ajaxui_config_dvb.c index b15fa74e..c06a398a 100644 --- a/ajaxui/ajaxui_config_dvb.c +++ b/ajaxui/ajaxui_config_dvb.c @@ -51,7 +51,7 @@ add_option(tcp_queue_t *tq, int bol, const char *name) /** * */ -const char * +static const char * nicenum(unsigned int v) { static char buf[4][30]; diff --git a/ajaxui/ajaxui_config_transport.c b/ajaxui/ajaxui_config_transport.c index 519abd5e..8f138647 100644 --- a/ajaxui/ajaxui_config_transport.c +++ b/ajaxui/ajaxui_config_transport.c @@ -307,7 +307,7 @@ dvb_unmap_channel(th_transport_t *t, tcp_queue_t *tq) /** * */ -int +static int ajax_transport_op(http_connection_t *hc, http_reply_t *hr, const char *remain, void *opaque) { @@ -351,7 +351,7 @@ ajax_transport_op(http_connection_t *hc, http_reply_t *hr, /** * */ -int +static int ajax_transport_chdisable(http_connection_t *hc, http_reply_t *hr, const char *remain, void *opaque) { diff --git a/ajaxui/ajaxui_mailbox.c b/ajaxui/ajaxui_mailbox.c index 7f8ed21e..3ac5eeec 100644 --- a/ajaxui/ajaxui_mailbox.c +++ b/ajaxui/ajaxui_mailbox.c @@ -32,6 +32,7 @@ #include "transports.h" #include "epg_xmltv.h" #include "dvb_support.h" +#include "ajaxui_mailbox.h" #define MAILBOX_UNUSED_TIMEOUT 15 #define MAILBOX_EMPTY_REPLY_TIMEOUT 10 @@ -454,7 +455,7 @@ ajax_mailbox_tda_change(th_dvb_adapter_t *tda) void -ajax_mailbox_xmltv_grabber_status_change(xmltv_grabber_t *xg, int status) +ajax_mailbox_xmltv_grabber_status_change(xmltv_grabber_t *xg) { char buf[500]; diff --git a/ajaxui/ajaxui_mailbox.h b/ajaxui/ajaxui_mailbox.h index 81654f8b..9aa86a60 100644 --- a/ajaxui/ajaxui_mailbox.h +++ b/ajaxui/ajaxui_mailbox.h @@ -21,8 +21,6 @@ #include "tcp.h" -int ajax_mailbox_create(const char *subscriptionid); - void ajax_mailbox_tdmi_state_change(th_dvb_mux_instance_t *tdmi); void ajax_mailbox_tdmi_qual_change(th_dvb_mux_instance_t *tdmi); diff --git a/autorec.c b/autorec.c index 3b87b790..66160363 100644 --- a/autorec.c +++ b/autorec.c @@ -57,7 +57,7 @@ autorec_init(void) /** * return 1 if the event 'e' is matched by the autorec rule 'ar' */ -int +static int autorec_cmp(autorec_t *ar, event_t *e) { if(ar->ar_ch != NULL && ar->ar_ch != e->e_ch) diff --git a/cwc.c b/cwc.c index 7aebf4f7..3d95eb18 100644 --- a/cwc.c +++ b/cwc.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include "ffdecsa/FFdecsa.h" #include "dispatch.h" #include "transports.h" +#include "cwc.h" #define CWC_KEEPALIVE_INTERVAL 600 @@ -639,7 +641,7 @@ cwc_tcp_callback(tcpevent_t event, void *tcpsession) /** * */ -void +static void cwc_table_input(struct th_descrambler *td, struct th_transport *t, struct th_stream *st, uint8_t *data, int len) { diff --git a/dispatch.h b/dispatch.h index 4b51c522..c8a02f0e 100644 --- a/dispatch.h +++ b/dispatch.h @@ -29,7 +29,7 @@ extern time_t dispatch_clock; #define DISPATCH_ERR 0x4 #define DISPATCH_PRI 0x8 -extern inline int64_t +static inline int64_t getclock_hires(void) { int64_t now; @@ -54,7 +54,7 @@ void dtimer_arm_hires(dtimer_t *ti, dti_callback_t *callback, void *aux, int64_t t); -extern inline void +static inline void dtimer_disarm(dtimer_t *ti) { if(ti->dti_callback) { diff --git a/dvb_tables.c b/dvb_tables.c index 09739b4b..9db59318 100644 --- a/dvb_tables.c +++ b/dvb_tables.c @@ -731,7 +731,7 @@ dvb_rst_callback(th_dvb_mux_instance_t *tdmi, uint8_t *ptr, int len, /** * Helper for preparing a section filter parameter struct */ -struct dmx_sct_filter_params * +static struct dmx_sct_filter_params * dvb_fparams_alloc(int pid, int flags) { struct dmx_sct_filter_params *p; diff --git a/epg.c b/epg.c index 3f7d481b..73dd7fd9 100644 --- a/epg.c +++ b/epg.c @@ -53,7 +53,7 @@ epg_event_set_desc(event_t *e, const char *desc) e->e_desc = strdup(desc); } -void +static void epg_event_set_content_type(event_t *e, epg_content_type_t *ect) { if(e->e_content_type != NULL) @@ -378,8 +378,6 @@ epg_set_current_event(th_channel_t *ch, event_t *e) /* Notify clients that a new programme is on */ - clients_send_ref(ch->ch_tag); - htsp_async_channel_update(ch); if(e == NULL) diff --git a/epg_xmltv.c b/epg_xmltv.c index 70191942..ba00efb2 100644 --- a/epg_xmltv.c +++ b/epg_xmltv.c @@ -38,7 +38,6 @@ #include "channels.h" #include "epg.h" #include "epg_xmltv.h" -#include "refstr.h" #include "spawn.h" #include "intercom.h" #include "notify.h" @@ -528,7 +527,7 @@ xmltv_thread(void *aux) /** * */ -void +static void xmltv_grabber_enqueue(xmltv_grabber_t *xg) { pthread_mutex_lock(&xmltv_work_lock); diff --git a/ffdecsa/FFdecsa.c b/ffdecsa/FFdecsa.c index ffc5147d..317f0ed3 100644 --- a/ffdecsa/FFdecsa.c +++ b/ffdecsa/FFdecsa.c @@ -537,11 +537,12 @@ void set_odd_control_word(void *keys, const unsigned char *pk){ } //-----get control words - +#if 0 void get_control_words(void *keys, unsigned char *even, unsigned char *odd){ memcpy(even,&((struct csa_keys_t *)keys)->even.ck,8); memcpy(odd,&((struct csa_keys_t *)keys)->odd.ck,8); } +#endif //----- decrypt diff --git a/ffdecsa/stream.c b/ffdecsa/stream.c index 1bda8521..c00482c6 100644 --- a/ffdecsa/stream.c +++ b/ffdecsa/stream.c @@ -436,14 +436,14 @@ static inline void trasp64_128_88cw(unsigned char *data){ #ifdef STREAM_INIT -void stream_cypher_group_init( +static void stream_cypher_group_init( struct stream_regs *regs, group iA[8][4], // [In] iA00,iA01,...iA73 32 groups | Derived from key. group iB[8][4], // [In] iB00,iB01,...iB73 32 groups | Derived from key. unsigned char *sb) // [In] (SB0,SB1,...SB7)...x32 32*8 bytes | Extra input. #endif #ifdef STREAM_NORMAL -void stream_cypher_group_normal( +static void stream_cypher_group_normal( struct stream_regs *regs, unsigned char *cb) // [Out] (CB0,CB1,...CB7)...x32 32*8 bytes | Output. #endif diff --git a/htsclient.c b/htsclient.c index cb8b4c11..66889bc0 100644 --- a/htsclient.c +++ b/htsclient.c @@ -40,6 +40,7 @@ #include "buffer.h" #include "tsmux.h" #include "tcp.h" +#include "htsclient.h" LIST_HEAD(client_list, client); @@ -72,12 +73,12 @@ typedef struct client { -static void client_status_update(void *aux, int64_t now); +void client_status_update(void *aux, int64_t now); #define cprintf(c, fmt...) tcp_printf(&(c)->c_tcp_session, fmt) -void +static void client_output_ts(void *opaque, th_subscription_t *s, uint8_t *pkt, int blocks, int64_t pcr) { @@ -114,36 +115,6 @@ client_output_ts(void *opaque, th_subscription_t *s, } - -/* - * - * - */ - -void -clients_send_ref(int ref) -{ - client_t *c; - char buf[10]; - uint32_t v = htonl(ref); - struct sockaddr_in sin; - - buf[0] = HTSTV_REFTAG; - memcpy(buf + 1, &v, sizeof(uint32_t)); - - LIST_FOREACH(c, &all_clients, c_global_link) { - if(c->c_streamfd == -1) - continue; - - sin.sin_family = AF_INET; - sin.sin_port = htons(c->c_port); - sin.sin_addr = c->c_ipaddr; - - sendto(c->c_streamfd, buf, 5, 0, - (struct sockaddr *)&sin, sizeof(sin)); - } -} - /* * */ @@ -175,7 +146,7 @@ cr_channel_info(client_t *c, char **argv, int argc) * */ -int +static int cr_channel_unsubscribe(client_t *c, char **argv, int argc) { th_subscription_t *s; @@ -228,7 +199,7 @@ client_subscription_callback(struct th_subscription *s, /* * */ -int +static int cr_channel_subscribe(client_t *c, char **argv, int argc) { th_channel_t *ch; @@ -272,7 +243,7 @@ cr_channel_subscribe(client_t *c, char **argv, int argc) * */ -int +static int cr_channels_list(client_t *c, char **argv, int argc) { th_channel_t *ch; @@ -290,7 +261,7 @@ cr_channels_list(client_t *c, char **argv, int argc) * */ -int +static int cr_streamport(client_t *c, char **argv, int argc) { if(argc < 2) @@ -579,7 +550,6 @@ htsclient_tcp_callback(tcpevent_t event, void *tcpsession) TAILQ_INIT(&c->c_refq); LIST_INSERT_HEAD(&all_clients, c, c_global_link); c->c_streamfd = -1; - dtimer_arm(&c->c_status_timer, client_status_update, c, 1); break; case TCP_DISCONNECT: @@ -604,67 +574,3 @@ client_start(void) htsclient_tcp_callback); } - - - - - - - - - -/* - * Periodically send status updates to client (on stream 2) - */ -static void -csprintf(client_t *c, th_channel_t *ch, const char *fmt, ...) -{ - va_list ap; - char buf[1000]; - struct sockaddr_in sin; - - memset(&sin, 0, sizeof(sin)); - - buf[0] = HTSTV_STATUS; - buf[1] = ch->ch_index; - - va_start(ap, fmt); - vsnprintf(buf + 2, sizeof(buf) - 2, fmt, ap); - va_end(ap); - - sin.sin_family = AF_INET; - sin.sin_port = htons(c->c_port); - sin.sin_addr = c->c_ipaddr; - - sendto(c->c_streamfd, buf, strlen(buf + 2) + 2, 0, - (struct sockaddr *)&sin, sizeof(sin)); -} - - -static void -client_status_update(void *aux, int64_t now) -{ - client_t *c = aux; - th_channel_t *ch; - th_subscription_t *s; - th_transport_t *t; - - dtimer_arm(&c->c_status_timer, client_status_update, c, 1); - - LIST_FOREACH(s, &c->c_subscriptions, ths_subscriber_link) { - - ch = s->ths_channel; - t = s->ths_transport; - - if(t == NULL) { - csprintf(c, ch, - "status = 0\n" - "info = No transport available"); - continue; - } - - csprintf(c, ch, - "status = 0\n" - "info = Running"); - } -} diff --git a/htsclient.h b/htsclient.h index 593950be..6d5ed224 100644 --- a/htsclient.h +++ b/htsclient.h @@ -23,6 +23,4 @@ void client_start(void); void clients_send_ref(int ref); -void client_status_update(void); - #endif /* HTSCLIENT_H_ */ diff --git a/iptv_output.c b/iptv_output.c index 4c1621ae..d8342b33 100644 --- a/iptv_output.c +++ b/iptv_output.c @@ -60,7 +60,7 @@ typedef struct output_multicast { /** * Output MPEG TS */ -void +static void iptv_output_ts(void *opaque, th_subscription_t *s, uint8_t *pkt, int blocks, int64_t pcr) { diff --git a/krypt.c b/krypt.c index 964826eb..32a19127 100644 --- a/krypt.c +++ b/krypt.c @@ -1,6 +1,8 @@ #define _XOPEN_SOURCE #include +char *cwc_krypt(const char *key, const char *salt); + char * cwc_krypt(const char *key, const char *salt) { diff --git a/mux.c b/mux.c index d0a3abc6..82862dc7 100644 --- a/mux.c +++ b/mux.c @@ -41,7 +41,7 @@ #include "subscriptions.h" #include "psi.h" #include "buffer.h" - +#include "mux.h" @@ -132,8 +132,7 @@ mux_new_packet(th_muxer_t *tm, th_stream_t *st, th_pkt_t *pkt) * TS Muxer */ th_muxer_t * -muxer_init(th_subscription_t *s, th_mux_output_t *cb, void *opaque, - int flags) +muxer_init(th_subscription_t *s, th_mux_output_t *cb, void *opaque) { th_transport_t *t = s->ths_transport; th_stream_t *st; diff --git a/pvr.c b/pvr.c index 69233f8f..d5271ce4 100644 --- a/pvr.c +++ b/pvr.c @@ -133,12 +133,9 @@ pvr_inform_status_change(pvr_rec_t *pvrr) { event_t *e; - clients_send_ref(pvrr->pvrr_ref); e = epg_event_find_by_time(pvrr->pvrr_channel, pvrr->pvrr_start); - if(e != NULL) - clients_send_ref(e->e_tag); } @@ -175,7 +172,6 @@ pvr_abort(pvr_rec_t *pvrr) pvr_fsm(pvrr); pvr_database_save(pvrr); - clients_send_ref(-1); return 0; } @@ -223,7 +219,6 @@ pvr_link_pvrr(pvr_rec_t *pvrr) } pvr_inform_status_change(pvrr); - clients_send_ref(-1); } diff --git a/rtsp.c b/rtsp.c index fd05c8b2..07aa5210 100644 --- a/rtsp.c +++ b/rtsp.c @@ -41,6 +41,7 @@ #include "tcp.h" #include "http.h" #include "access.h" +#include "rtsp.h" #include diff --git a/teletext.c b/teletext.c index d37f206a..35345e17 100644 --- a/teletext.c +++ b/teletext.c @@ -139,7 +139,7 @@ tt_construct_unix_time(char *buf) -int +static int str_is_tt_clock(const char *str) { return diff --git a/transports.c b/transports.c index 9b70ee8d..ad5af932 100644 --- a/transports.c +++ b/transports.c @@ -326,7 +326,7 @@ transport_find(th_channel_t *ch, unsigned int weight) * */ -void +static void transport_flush_subscribers(th_transport_t *t) { th_subscription_t *s; diff --git a/tvhead.h b/tvhead.h index a314a2d9..322bd96c 100644 --- a/tvhead.h +++ b/tvhead.h @@ -27,7 +27,6 @@ #include #include #include -#include "refstr.h" #include /* @@ -894,8 +893,6 @@ typedef struct event { #define EVENT_SRC_XMLTV 1 #define EVENT_SRC_DVB 2 - refstr_t *e_icon; - } event_t; config_entry_t *find_mux_config(const char *muxtype, const char *muxname); @@ -909,7 +906,7 @@ FILE *settings_open_for_read(const char *name); extern const char *sys_warning; extern th_channel_group_t *defgroup; -extern inline unsigned int tvh_strhash(const char *s, unsigned int mod) +static inline unsigned int tvh_strhash(const char *s, unsigned int mod) { unsigned int v = 5381; while(*s) diff --git a/xbmsp.c b/xbmsp.c index 60de361f..412e6907 100644 --- a/xbmsp.c +++ b/xbmsp.c @@ -48,7 +48,7 @@ extern AVOutputFormat mpegts_muxer; * Function for delivery of data. * We try to respond to any pending read */ -void +static void xbmsp_output_file(void *opaque) { xbmsp_subscrption_t *xs = opaque; @@ -218,7 +218,7 @@ xbmsp_dir_add_entry(xbmsp_dirhandle_t *xdh, const char *name, /** * */ -th_channel_group_t * +static th_channel_group_t * xbmsp_cur_channel_group(xbmsp_t *xbmsp) { th_channel_group_t *tcg; @@ -314,7 +314,7 @@ xbmsp_close_dirhandle(xbmsp_t *xbmsp, uint32_t handle) /** * xbmsp_cdup() - Change to one directory up (cd ..) */ -const char * +static const char * xbmsp_cdup(xbmsp_t *xbmsp) { char *wd = xbmsp->xbmsp_wd; @@ -332,7 +332,7 @@ xbmsp_cdup(xbmsp_t *xbmsp) /** * xbmsp_cdroot() - Change to root (cd /) */ -const char * +static const char * xbmsp_cdroot(xbmsp_t *xbmsp) { free(xbmsp->xbmsp_wd); @@ -343,7 +343,7 @@ xbmsp_cdroot(xbmsp_t *xbmsp) /** * xbmsp_cddown() - Change to root (cd dir) */ -const char * +static const char * xbmsp_cddown(xbmsp_t *xbmsp, const char *dir) { th_channel_group_t *tcg;