From ef10ad3e9fe89014380963fdb390cd718c4e69db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96man?= Date: Fri, 2 May 2008 19:29:14 +0000 Subject: [PATCH] Remove 'channelname' from map function call --- ajaxui/ajaxui_config_transport.c | 4 ++-- avgen.c | 3 ++- dvb.c | 4 ++-- file_input.c | 3 ++- iptv_input.c | 2 +- serviceprobe.c | 2 +- transports.c | 6 +++--- transports.h | 4 ++-- v4l.c | 4 +++- 9 files changed, 18 insertions(+), 14 deletions(-) diff --git a/ajaxui/ajaxui_config_transport.c b/ajaxui/ajaxui_config_transport.c index 13bb54bf..2460d4e1 100644 --- a/ajaxui/ajaxui_config_transport.c +++ b/ajaxui/ajaxui_config_transport.c @@ -273,7 +273,7 @@ ajax_transport_rename_channel(http_connection_t *hc, http_reply_t *hr, static void dvb_map_channel(th_transport_t *t, tcp_queue_t *tq) { - transport_set_channel(t, t->tht_channelname); + transport_map_channel(t); printf("Mapped transport %s to channel %s\n", t->tht_servicename, t->tht_channel->ch_name); @@ -292,7 +292,7 @@ dvb_map_channel(th_transport_t *t, tcp_queue_t *tq) static void dvb_unmap_channel(th_transport_t *t, tcp_queue_t *tq) { - transport_unset_channel(t); + transport_unmap_channel(t); printf("Unmapped transport %s\n", t->tht_servicename); diff --git a/avgen.c b/avgen.c index 6b71702b..c69d21ca 100644 --- a/avgen.c +++ b/avgen.c @@ -116,8 +116,9 @@ avgen_init(void) t->tht_provider = strdup("HTS Tvheadend"); t->tht_identifier = strdup("test1"); + t->tht_servicename = strdup("test1"); - transport_set_channel(t, ch->ch_name); + transport_map_channel(t); } diff --git a/dvb.c b/dvb.c index c6479af3..0cd9baee 100644 --- a/dvb.c +++ b/dvb.c @@ -648,7 +648,7 @@ dvb_tdmi_load(th_dvb_mux_instance_t *tdmi) psi_load_transport(&ce->ce_sub, t); if(atoi(config_get_str_sub(&ce->ce_sub, "mapped", "0"))) { - transport_set_channel(t, t->tht_channelname); + transport_map_channel(t); } } config_free0(&cl); @@ -745,7 +745,7 @@ dvb_tda_clone(th_dvb_adapter_t *dst, th_dvb_adapter_t *src) t_dst->tht_channelname = strdup(t_src->tht_channelname); if(t_src->tht_channel != NULL) - transport_set_channel(t_dst, t_src->tht_channel->ch_name); + transport_map_channel(t_dst); diff --git a/file_input.c b/file_input.c index 6694e9bc..9adfc769 100644 --- a/file_input.c +++ b/file_input.c @@ -156,7 +156,8 @@ file_input_init(void) t->tht_provider = strdup("HTS Tvheadend"); t->tht_identifier = strdup(ch->ch_name); t->tht_file_input = fi; - transport_set_channel(t, ch->ch_name); + t->tht_servicename = strdup(ch->ch_name); + transport_map_channel(t); } } diff --git a/iptv_input.c b/iptv_input.c index e87a8a13..56aafc3d 100644 --- a/iptv_input.c +++ b/iptv_input.c @@ -278,7 +278,7 @@ iptv_probe_done(th_transport_t *t, int timeout) iptv_stop_feed(t); if(!timeout) - transport_set_channel(t, t->tht_channelname); + transport_map_channel(t); else LIST_INSERT_HEAD(&iptv_stale_transports, t, tht_active_link); diff --git a/serviceprobe.c b/serviceprobe.c index eb4b02a7..8e7262ca 100644 --- a/serviceprobe.c +++ b/serviceprobe.c @@ -107,7 +107,7 @@ sp_timeout(void *aux, int64_t now) if(sp->sp_error == 0) { if(t->tht_channel == NULL && t->tht_servicename != NULL) { - transport_set_channel(t, t->tht_servicename); + transport_map_channel(t); t->tht_config_change(t); } } diff --git a/transports.c b/transports.c index 6ad32110..9b70ee8d 100644 --- a/transports.c +++ b/transports.c @@ -524,9 +524,9 @@ transport_add_stream(th_transport_t *t, int pid, tv_streamtype_t type) * */ void -transport_set_channel(th_transport_t *t, const char *chname) +transport_map_channel(th_transport_t *t) { - th_channel_t *ch = channel_find(chname, 1, NULL); + th_channel_t *ch = channel_find(t->tht_servicename, 1, NULL); assert(t->tht_channel == NULL); @@ -543,7 +543,7 @@ transport_set_channel(th_transport_t *t, const char *chname) * */ void -transport_unset_channel(th_transport_t *t) +transport_unmap_channel(th_transport_t *t) { t->tht_channel = NULL; LIST_REMOVE(t, tht_channel_link); diff --git a/transports.h b/transports.h index 4c750c49..5867a621 100644 --- a/transports.h +++ b/transports.h @@ -32,9 +32,9 @@ th_transport_t *transport_create(const char *identifier, int type, th_transport_t *transport_find_by_identifier(const char *identifier); -void transport_set_channel(th_transport_t *t, const char *name); +void transport_map_channel(th_transport_t *t); -void transport_unset_channel(th_transport_t *t); +void transport_unmap_channel(th_transport_t *t); th_transport_t *transport_find(th_channel_t *ch, unsigned int weight); diff --git a/v4l.c b/v4l.c index 09b83980..88420fb6 100644 --- a/v4l.c +++ b/v4l.c @@ -97,7 +97,9 @@ v4l_configure_transport(th_transport_t *t, const char *muxname, snprintf(buf, sizeof(buf), "analog_%u", t->tht_v4l_frequency); t->tht_identifier = strdup(buf); - transport_set_channel(t, channel_name); + t->tht_servicename = strdup(channel_name); + + transport_map_channel(t); return 0; }