339
GList *list_parse_qt2(GList * list, ListItem * item)
348
printf("Entering list_parse_qt2 localsize = %i\n", item->localsize);
350
if (item->localsize < (256 * 1024)) {
351
if (g_file_get_contents(item->local, &data, &datalen, NULL)) {
352
//printf("read %i bytes from %s\n",datalen, item->local);
353
p = (gchar *) memmem_compat(data, datalen, "mmdr", 4);
355
printf("unable to find mmdr in %s\n", item->local);
359
urlptr = (gchar *) memmem(p,datalen - (p - data), "url ", 4);
362
if (urlptr == NULL) {
365
urlptr += strlen("url ");
366
g_strlcpy(url, item->src, 1024);
367
ptr = g_strrstr(url, "/");
368
if (ptr != NULL && g_strrstr(urlptr, "://") == NULL) {
370
ptr[0] = (char) NULL;
371
g_strlcat(url, urlptr, 1024);
373
g_strlcpy(url, urlptr, 1024);
376
if (list_find(list, url) == NULL) {
378
newitem = g_new0(ListItem, 1);
379
g_strlcpy(newitem->src, url, 1024);
380
// newitem->streaming = streaming(newitem->src);
381
newitem->play = TRUE;
382
newitem->id = item->id;
383
newitem->controlid = item->controlid;
384
g_strlcpy(newitem->path, item->path, 1024);
386
list = g_list_append(list, newitem);
388
p = (gchar *) memmem(urlptr,datalen - (urlptr - data),"mmdr",4);
396
// printf("Unable to open %s \n",item->local);
400
// if file is over 256K it is probably not a playlist
401
// so skip parsing it.
402
//printf("file not parsed > 256K actual size is %i\n",item->localsize);
405
printf("Exiting list_parse_qt2\n");
339
410
void strip_unicode(gchar * data, gsize len)