comparison src/http.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 a9f60d56d673
children e040d91c5cc7
comparison
equal deleted inserted replaced
151:f7f594bf4e98 152:30e91361506a
341 struct web_file_t *file; 341 struct web_file_t *file;
342 int i, fd, upnp_id = 0; 342 int i, fd, upnp_id = 0;
343 extern thread_data *gp_tdata; 343 extern thread_data *gp_tdata;
344 thread_data *tdata = gp_tdata; 344 thread_data *tdata = gp_tdata;
345 int channel_length = 0; 345 int channel_length = 0;
346 char tmp[1024];
347 char *p;
348 tmp[0] = '\0';
346 349
347 if (!filename) 350 if (!filename)
348 return NULL; 351 return NULL;
349 352
350 if (mode != UPNP_READ) 353 if (mode != UPNP_READ)
374 377
375 /* 378 /*
376 * 1. http_open() $B$G$O(B entry $B$,%9%H%j!<%`:F@8MQ$N$b$N$G$"$k>l9g$K!"(B 379 * 1. http_open() $B$G$O(B entry $B$,%9%H%j!<%`:F@8MQ$N$b$N$G$"$k>l9g$K!"(B
377 * get_file_stream()$B$r8F$S=P$7%O%s%I%i$rJV5Q$9$k(B 380 * get_file_stream()$B$r8F$S=P$7%O%s%I%i$rJV5Q$9$k(B
378 */ 381 */
379 log_verbose ("Fullpath : %s\n", entry->fullpath); 382 for (i=0; i < ut->channel_list->nr_channel; i++) {
380 if (ut->nr_channel == 0) { 383 if (!strcmp(entry->fullpath, ut->channel_list->channel_info[i]->sid)) {
381 if (!strcmp (entry->fullpath, STREAM_LOCATION)) 384 ut->sid = ut->channel_list->channel_info[i]->sid;
382 return get_file_stream (STREAM_LOCATION, tdata); 385 ut->tp = ut->channel_list->channel_info[i]->tp;
383 } else { 386 return get_file_stream (ut->sid, tdata);
384 for (i=0; i < ut->nr_channel; i++) 387 }
385 if (!strcmp(entry->fullpath, ut->location_name[i])) {
386 channel_length = strspn(ut->channel_name[i], "0123456789");
387 strncpy(ut->request_channel, ut->channel_name[i], channel_length);
388 log_verbose ("http_open: request_channel[%s].\n", ut->request_channel);
389 return get_file_stream (ut->location_name[i], tdata);
390 }
391 } 388 }
392 389
393 fd = open (entry->fullpath, O_RDONLY | O_NONBLOCK | O_SYNC | O_NDELAY); 390 fd = open (entry->fullpath, O_RDONLY | O_NONBLOCK | O_SYNC | O_NDELAY);
394 if (fd < 0) 391 if (fd < 0)
395 return NULL; 392 return NULL;