]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
try to fix find_by_identifier mess
authorJaroslav Kysela <perex@perex.cz>
Fri, 15 Dec 2017 16:41:45 +0000 (17:41 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 18 Dec 2017 08:39:10 +0000 (09:39 +0100)
src/api/api_service.c
src/bouquet.c
src/channels.c
src/channels.h
src/epgdb.c
src/epggrab/module/eit.c
src/htsp_server.c
src/service.h
src/subscriptions.c
src/webui/webui.c
src/webui/xmltv.c

index fa39a4c4826261fa3a3392b79befd321a20554fb..8ecd870cc00fc40ae64db0627ddacfbb6488e8a5 100644 (file)
@@ -123,7 +123,7 @@ api_service_streams
   pthread_mutex_lock(&global_lock);
 
   /* Couldn't find */
-  if (!(s = service_find(uuid))) {
+  if (!(s = service_find_by_uuid(uuid))) {
     pthread_mutex_unlock(&global_lock);
     return EINVAL;
   }
index 6dcf39d3f7f069c9b875d097d040f6056a95e4d3..d6f2686849215fa77b0d6af9c4b9f91fa4206cd0 100644 (file)
@@ -1296,7 +1296,7 @@ bouquet_service_resolve(void)
         if ((e = htsmsg_field_get_map(f)) == NULL) continue;
         lcn = htsmsg_get_s64_or_default(e, "lcn", 0);
         tag = htsmsg_get_str(e, "tag");
-        s = service_find_by_identifier(f->hmf_name);
+        s = service_find_by_uuid(f->hmf_name);
         if (s)
           bouquet_add_service(bq, s, lcn, tag);
       }
index 4d7b46b0ba4b51e707507ae7bb0a89c1c96f92dc..a7cf3239a3007feb13856b80a32644fa2f139a65 100644 (file)
@@ -1659,7 +1659,7 @@ channel_tag_find_by_name(const char *name, int create)
  *
  */
 channel_tag_t *
-channel_tag_find_by_identifier(uint32_t id) {
+channel_tag_find_by_id(uint32_t id) {
   channel_tag_t *ct;
 
   TAILQ_FOREACH(ct, &channel_tags, ct_link) {
index d10d0e7abcb666855a691aca7c4a1dfc025e678f..7696763215cb4e017794b5c401d6196ad10cce30 100644 (file)
@@ -156,7 +156,7 @@ channel_tag_t *channel_tag_create(const char *uuid, htsmsg_t *conf);
 
 channel_tag_t *channel_tag_find_by_name(const char *name, int create);
 
-channel_tag_t *channel_tag_find_by_identifier(uint32_t id);
+channel_tag_t *channel_tag_find_by_id(uint32_t id);
 
 static inline channel_tag_t *channel_tag_find_by_uuid(const char *uuid)
   {  return (channel_tag_t*)idnode_find(uuid, &channel_tag_class, NULL); }
index 1acb961ea0413159f1f6708a44978a0a465f9a84..bc98c6ac409ddab4b7a9fb615bb3de1b5c9356aa 100644 (file)
@@ -66,7 +66,7 @@ static void _epgdb_v1_process ( htsmsg_t *c, epggrab_stats_t *stats )
 
   /* Check key info */
   if(htsmsg_get_u32(c, "ch_id", &ch_id)) return;
-  if((ch = channel_find_by_identifier(ch_id)) == NULL) return;
+  if((ch = channel_find_by_id(ch_id)) == NULL) return;
   if(htsmsg_get_u32(c, "start", &e_start)) return;
   if(htsmsg_get_u32(c, "stop", &e_stop)) return;
   if(!(title = htsmsg_get_str(c, "title"))) return;
index d502d1626b1ddcf99ea3cc3c57ef29e6e4c37694..dc1f2383749da3e617b2f29b9443f130e88ee1b9 100644 (file)
@@ -811,7 +811,7 @@ _eit_process_data(void *m, void *data, uint32_t len)
   memcpy(&ed, data, sizeof(ed));
   data += sizeof(ed);
   len -= sizeof(ed);
-  svc = (mpegts_service_t *)service_find0(&ed.svc_uuid);
+  svc = (mpegts_service_t *)service_find_by_uuid0(&ed.svc_uuid);
   if (svc == NULL)
     return;
   pthread_mutex_lock(&global_lock);
index a6f52df42b866a4256655c51e090fdde80418faf..eaaf9201f295c3cd10a3b97f9948c3fa96ca31d6 100644 (file)
@@ -701,7 +701,7 @@ htsp_channel_tag_get_identifier(channel_tag_t *ct)
 }
 
 static channel_tag_t *
-htsp_channel_tag_find_by_identifier(htsp_connection_t *htsp, uint32_t id)
+htsp_channel_tag_find_by_id(htsp_connection_t *htsp, uint32_t id)
 {
   channel_tag_t *ct;
 
@@ -1752,7 +1752,7 @@ htsp_method_epgQuery(htsp_connection_t *htsp, htsmsg_t *in)
       eq.channel = strdup(idnode_uuid_as_str(&ch->ch_id, ubuf));
   }
   if(!(htsmsg_get_u32(in, "tagId", &u32))) {
-    if (!(ct = htsp_channel_tag_find_by_identifier(htsp, u32)))
+    if (!(ct = htsp_channel_tag_find_by_id(htsp, u32)))
       return htsp_error(htsp, N_("Channel tag does not exist"));
     else
       eq.channel_tag = strdup(idnode_uuid_as_str(&ct->ct_id, ubuf));
index 4dd11008f5bca8ebf9d102df19ec6eacd3f36183..993bab0d0f075fd41ac0fb68021fd8d607611225 100644 (file)
@@ -537,11 +537,10 @@ void service_unref(service_t *t);
 
 void service_ref(service_t *t);
 
-static inline service_t *service_find(const char *identifier)
-  { return idnode_find(identifier, &service_class, NULL); }
-static inline service_t *service_find0(tvh_uuid_t *uuid)
+static inline service_t *service_find_by_uuid(const char *uuid)
+  { return idnode_find(uuid, &service_class, NULL); }
+static inline service_t *service_find_by_uuid0(tvh_uuid_t *uuid)
   { return idnode_find0(uuid, &service_class, NULL); }
-#define service_find_by_identifier service_find
 
 service_instance_t *service_find_instance(struct service *s,
                                           struct channel *ch,
index a176c9626f461dd25fed6ce2c915a5f106f53e60..1922ef8b3255d2e010f4d8dd5ffcde7aa822697a 100644 (file)
@@ -1284,7 +1284,7 @@ dummy_retry(void *opaque)
 void
 subscription_dummy_join(const char *id, int first)
 {
-  service_t *t = service_find_by_identifier(id);
+  service_t *t = service_find_by_uuid(id);
   profile_chain_t *prch;
   streaming_target_t *st;
   th_subscription_t *s;
index bd013ecb439096148f2f5735728062667737eb87..b92f5f393a044f2028cebce4a6a6f0d1da99240a 100644 (file)
@@ -1087,7 +1087,7 @@ page_http_playlist(http_connection_t *hc, const char *remain, void *opaque)
   else if(nc == 2 && !strcmp(components[0], "dvrid"))
     de = dvr_entry_find_by_id(atoi(components[1]));
   else if(nc == 2 && !strcmp(components[0], "tagid"))
-    tag = channel_tag_find_by_identifier(atoi(components[1]));
+    tag = channel_tag_find_by_id(atoi(components[1]));
   else if(nc == 2 && !strcmp(components[0], "tagname"))
     tag = channel_tag_find_by_name(components[1], 0);
   else if(nc == 2 && !strcmp(components[0], "tag")) {
@@ -1395,7 +1395,7 @@ http_stream(http_connection_t *hc, const char *remain, void *opaque)
   } else if(!strcmp(components[0], "channel")) {
     ch = channel_find(components[1]);
   } else if(!strcmp(components[0], "service")) {
-    service = service_find_by_identifier(components[1]);
+    service = service_find_by_uuid(components[1]);
 #if ENABLE_MPEGTS
   } else if(!strcmp(components[0], "mux")) {
     // TODO: do we want to be able to force starting a particular instance
index 7bdcc95ea8882a9893646fe4af7336e288bd0a8b..df8f8c439d57fb1e1b1bb98f47c9e0923afd3578 100644 (file)
@@ -282,7 +282,7 @@ page_xmltv(http_connection_t *hc, const char *remain, void *opaque)
   else if (nc == 2 && !strcmp(components[0], "channel"))
     ch = channel_find(components[1]);
   else if (nc == 2 && !strcmp(components[0], "tagid"))
-    tag = channel_tag_find_by_identifier(atoi(components[1]));
+    tag = channel_tag_find_by_id(atoi(components[1]));
   else if (nc == 2 && !strcmp(components[0], "tagname"))
     tag = channel_tag_find_by_name(components[1], 0);
   else if (nc == 2 && !strcmp(components[0], "tag"))