comparison src/audacious/input.c @ 2331:d7ccaa59630f trunk

[svn] Wiped out some error messages
author mf0102
date Sun, 14 Jan 2007 10:54:06 -0800
parents 3149d4b1a9a9
children f140d0a27093
comparison
equal deleted inserted replaced
2330:716975bb5b65 2331:d7ccaa59630f
422 fd = vfs_fopen(filename, "rb"); 422 fd = vfs_fopen(filename, "rb");
423 423
424 ext = strrchr(filename_proxy, '.') + 1; 424 ext = strrchr(filename_proxy, '.') + 1;
425 425
426 use_ext_filter = (fd != NULL && 426 use_ext_filter = (fd != NULL &&
427 (!g_strcasecmp(fd->base->uri_id, "/") || 427 (!g_strcasecmp(fd->base->uri_id, "/") ||
428 !g_strcasecmp(fd->base->uri_id, "file"))) ? TRUE : FALSE; 428 !g_strcasecmp(fd->base->uri_id, "file"))) ? TRUE : FALSE;
429 429
430 for (node = get_input_list(); node != NULL; node = g_list_next(node)) 430 for (node = get_input_list(); node != NULL; node = g_list_next(node))
431 { 431 {
432 ip = INPUT_PLUGIN(node->data); 432 ip = INPUT_PLUGIN(node->data);
433 433
435 continue; 435 continue;
436 436
437 vfs_fseek(fd, 0, SEEK_SET); 437 vfs_fseek(fd, 0, SEEK_SET);
438 438
439 if (cfg.use_extension_probing == TRUE && ip->vfs_extensions != NULL 439 if (cfg.use_extension_probing == TRUE && ip->vfs_extensions != NULL
440 && ext != NULL && ext != (gpointer) 0x1 && use_ext_filter == TRUE) 440 && ext != NULL && ext != (gpointer) 0x1 && use_ext_filter == TRUE)
441 { 441 {
442 gint i; 442 gint i;
443 gboolean is_our_ext = FALSE; 443 gboolean is_our_ext = FALSE;
444 444
445 for (i = 0; ip->vfs_extensions[i] != NULL; i++) 445 for (i = 0; ip->vfs_extensions[i] != NULL; i++)
446 { 446 {
447 if (str_has_prefix_nocase(ext, ip->vfs_extensions[i])) 447 if (str_has_prefix_nocase(ext, ip->vfs_extensions[i]))
448 { 448 {
449 is_our_ext = TRUE; 449 is_our_ext = TRUE;
450 break; 450 break;
451 } 451 }
452 } 452 }
453 453
454 /* not a plugin that supports this extension */ 454 /* not a plugin that supports this extension */
455 if (is_our_ext == FALSE) 455 if (is_our_ext == FALSE)
456 continue; 456 continue;
477 vfs_fclose(fd); 477 vfs_fclose(fd);
478 return ip; 478 return ip;
479 } 479 }
480 } 480 }
481 481
482 if (ret <= -1) 482 if (ret <= -1)
483 break; 483 break;
484 } 484 }
485 485
486 g_free(filename_proxy); 486 g_free(filename_proxy);
487 487
488 if (show_warning && ret != -1) 488 if (show_warning && ret != -1)
510 void 510 void
511 input_get_song_info(const gchar * filename, gchar ** title, gint * length) 511 input_get_song_info(const gchar * filename, gchar ** title, gint * length)
512 { 512 {
513 InputPlugin *ip = NULL; 513 InputPlugin *ip = NULL;
514 BmpTitleInput *input; 514 BmpTitleInput *input;
515 GList *node;
516 gchar *tmp = NULL, *ext; 515 gchar *tmp = NULL, *ext;
517 gchar *filename_proxy; 516 gchar *filename_proxy;
518 517
519 g_return_if_fail(filename != NULL); 518 g_return_if_fail(filename != NULL);
520 g_return_if_fail(title != NULL); 519 g_return_if_fail(title != NULL);
522 521
523 filename_proxy = g_strdup(filename); 522 filename_proxy = g_strdup(filename);
524 523
525 ip = input_check_file(filename_proxy, FALSE); 524 ip = input_check_file(filename_proxy, FALSE);
526 525
527 if (ip && node && ip->get_song_info) { 526 if (ip && ip->get_song_info) {
528 ip->get_song_info(filename_proxy, &tmp, length); 527 ip->get_song_info(filename_proxy, &tmp, length);
529 *title = str_to_utf8(tmp); 528 *title = str_to_utf8(tmp);
530 g_free(tmp); 529 g_free(tmp);
531 } 530 }
532 else { 531 else {
560 TitleInput * 559 TitleInput *
561 input_get_song_tuple(const gchar * filename) 560 input_get_song_tuple(const gchar * filename)
562 { 561 {
563 InputPlugin *ip = NULL; 562 InputPlugin *ip = NULL;
564 TitleInput *input; 563 TitleInput *input;
565 GList *node;
566 gchar *tmp = NULL, *ext; 564 gchar *tmp = NULL, *ext;
567 gchar *filename_proxy; 565 gchar *filename_proxy;
568 566
569 if (filename == NULL) 567 if (filename == NULL)
570 return NULL; 568 return NULL;
571 569
572 filename_proxy = g_strdup(filename); 570 filename_proxy = g_strdup(filename);
573 571
574 ip = input_check_file(filename_proxy, FALSE); 572 ip = input_check_file(filename_proxy, FALSE);
575 573
576 if (ip && node && ip->get_song_tuple) 574 if (ip && ip->get_song_tuple)
577 input = ip->get_song_tuple(filename_proxy); 575 input = ip->get_song_tuple(filename_proxy);
578 else { 576 else
577 {
579 input = bmp_title_input_new(); 578 input = bmp_title_input_new();
580 579
581 tmp = g_strdup(filename); 580 tmp = g_strdup(filename);
582 if ((ext = strrchr(tmp, '.'))) 581 if ((ext = strrchr(tmp, '.')))
583 *ext = '\0'; 582 *ext = '\0';
584 583
585 input->track_name = NULL; 584 input->track_name = NULL;
586 input->length = -1; 585 input->length = -1;
587 input_get_song_info(filename, &input->track_name, &input->length); 586 input_get_song_info(filename, &input->track_name, &input->length);
588 input->file_name = g_path_get_basename(tmp); 587 input->file_name = g_path_get_basename(tmp);
589 input->file_ext = ext ? ext + 1 : NULL; 588 input->file_ext = ext ? ext + 1 : NULL;
590 input->file_path = g_path_get_dirname(tmp); 589 input->file_path = g_path_get_dirname(tmp);
591 } 590 }
592 591
668 } 667 }
669 668
670 void 669 void
671 input_file_info_box(const gchar * filename) 670 input_file_info_box(const gchar * filename)
672 { 671 {
673 GList *node;
674 InputPlugin *ip; 672 InputPlugin *ip;
675 gchar *filename_proxy; 673 gchar *filename_proxy;
676 674
677 filename_proxy = g_strdup(filename); 675 filename_proxy = g_strdup(filename);
678 676