Mercurial > pt1.oyama
diff src/recpt1.c @ 155:5d010d0ff6a1
Change line number of the CSV file to be used for ID management.
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Sun, 02 Sep 2012 20:52:45 +0900 |
parents | 578ebda88997 |
children | 159a729b90eb |
line wrap: on
line diff
--- a/src/recpt1.c Sun Sep 02 16:38:43 2012 +0900 +++ b/src/recpt1.c Sun Sep 02 20:52:45 2012 +0900 @@ -58,7 +58,9 @@ int close_tuner(thread_data *tdata); static int get_device_id_by_name ( const char *name ); -static struct channel_info_list *open_list_file(char *type) +static struct channel_info_list *open_list_file( + char *type, + struct channel_info_list *info_list) { char *buf = NULL; char filename[PATH_MAX]; @@ -74,10 +76,13 @@ if(!f) { return channel_info_list; } - channel_info_list = malloc(sizeof(*channel_info_list)); - if(!channel_info_list) - return NULL; - channel_info_list->nr_channel = 0; + if(!info_list) { + channel_info_list = malloc(sizeof(*channel_info_list)); + if(!channel_info_list) + return NULL; + channel_info_list->nr_channel = 0; + } else + channel_info_list = info_list; while(1) { buf = NULL; buf = malloc(256); @@ -97,6 +102,7 @@ channel_info->tp = NULL; channel_info->name = NULL; + channel_info->id = channel_info_list->nr_channel; channel_info->sid = buf; p = strchr(buf, C_CHAR_COMMA); @@ -1518,8 +1524,12 @@ /* initialize DLNA */ if(use_dlna) { do { - if(use_splitter) - channel_list = open_list_file("ISDB"); + if(use_splitter && tdata.table->type == CHTYPE_GROUND) + channel_list = open_list_file("ISDB", NULL); + else { + channel_list = open_list_file("BS", NULL); + channel_list = open_list_file("CS", channel_list); + } tdata.stream_queue = stream_queue; tdata.streamer = malloc(sizeof(streamer)); if ( tdata.streamer == NULL ) {