diff src/metadata.c @ 152:30e91361506a

EXPERIMENTAL: Enable change phisical channel by DLNA.(ISDB-T only)
author Naoya OYAMA <naoya.oyama@gmail.com>
date Sun, 02 Sep 2012 01:59:27 +0900
parents 066f33b2213a
children 5d010d0ff6a1
line wrap: on
line diff
--- a/src/metadata.c	Fri Aug 31 23:39:46 2012 +0900
+++ b/src/metadata.c	Sun Sep 02 01:59:27 2012 +0900
@@ -38,6 +38,7 @@
 #include "content.h"
 #include "gettext.h"
 #include "trace.h"
+#include "recpt1.h"
 
 #define TITLE_UNKNOWN "unknown"
 
@@ -556,56 +557,20 @@
   if (!ut->root_entry)
     ut->root_entry = upnp_entry_new (ut, "root", NULL, NULL, -1, true);
 
-#if 0
-  entry = upnp_entry_new (ut, "stream.ts", "/web/stream.ts",
-                          ut->root_entry, -1, false);
-    upnp_entry_add_child (ut, ut->root_entry, entry);
-    metadata_add_container (ut, entry, "/web/");
-#endif
   struct upnp_entry_t *entry = ut->root_entry;
   st.st_size = 100*1024*1024;
-  if (ut->nr_channel == 0) {
-    metadata_add_file (ut, ut->root_entry, STREAM_LOCATION, STREAM_FILE_NAME, &st);
-  } else {
-    for (i=0; i < ut->nr_channel; i++)
-      metadata_add_file (ut, ut->root_entry, ut->location_name[i], ut->channel_name[i], &st);
+  for(i=0; i < ut->channel_list->nr_channel; i++) {
+      char name[1024];
+      name[0] = '\0';
+      strncpy(name, ut->channel_list->channel_info[i]->name, sizeof(name));
+      strncat(name, ".ts", sizeof(name));
+      metadata_add_file (ut,
+                         ut->root_entry,
+                         ut->channel_list->channel_info[i]->sid,
+                         name,
+                         &st);
   }
   ut->contentlist = NULL;
-  //metadata_add_container (ut, ut->root_entry, "/web/");
-
-#if 0
-  /* add files from content directory */
-  for (i=0 ; i < ut->contentlist->count ; i++)
-  {
-    struct upnp_entry_t *entry = NULL;
-    char *title = NULL;
-    int size = 0;
-
-    log_info (_("Looking for files in content directory : %s\n"),
-              ut->contentlist->content[i]);
-
-    size = strlen (ut->contentlist->content[i]);
-    if (ut->contentlist->content[i][size - 1] == '/')
-      ut->contentlist->content[i][size - 1] = '\0';
-    title = strrchr (ut->contentlist->content[i], '/');
-    if (title)
-      title++;
-    else
-    {
-      /* directly use content directory name if no '/' before basename */
-      title = ut->contentlist->content[i];
-    }
-
-    entry = upnp_entry_new (ut, title, ut->contentlist->content[i],
-                            ut->root_entry, -1, true);
-
-    if (!entry)
-      continue;
-    upnp_entry_add_child (ut, ut->root_entry, entry);
-    metadata_add_container (ut, entry, ut->contentlist->content[i]);
-  }
-#endif
-
   log_info (_("Found %d files and subdirectories.\n"), ut->nr_entries);
   ut->init = 1;
 }