comparison src/madplug/fileinfo.c @ 1329:4b07404814ca

- reduce the number of file open in loading. - make use of new vfs_is_remote() and vfs_is_streaming().
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Sun, 22 Jul 2007 22:21:28 +0900
parents 38fb3bb3e21e
children a19e4395eaff
comparison
equal deleted inserted replaced
1328:38fb3bb3e21e 1329:4b07404814ca
585 static char const *const layer_str[3] = { "I", "II", "III" }; 585 static char const *const layer_str[3] = { "I", "II", "III" };
586 static char const *const mode_str[4] = { 586 static char const *const mode_str[4] = {
587 ("single channel"), ("dual channel"), "joint stereo", "stereo" 587 ("single channel"), ("dual channel"), "joint stereo", "stereo"
588 }; 588 };
589 gchar *tmp, *utf_filename; 589 gchar *tmp, *utf_filename;
590 590 gchar *realfn = NULL;
591 #ifdef DEBUG 591 #ifdef DEBUG
592 { 592 {
593 tmp = str_to_utf8(fileurl); 593 tmp = str_to_utf8(fileurl);
594 g_message("f: audmad_get_file_info: %s", tmp); 594 g_message("f: audmad_get_file_info: %s", tmp);
595 g_free(tmp); 595 g_free(tmp);
596 tmp = NULL; 596 tmp = NULL;
597 } 597 }
598 #endif 598 #endif
599 599
600 if(!vfs_file_test(fileurl, G_FILE_TEST_EXISTS)) { 600 if(!vfs_is_remote(fileurl) && !vfs_file_test(fileurl, G_FILE_TEST_EXISTS)) {
601 return; 601 return;
602 } 602 }
603 603
604 input_init(&info, fileurl, NULL); 604 input_init(&info, fileurl, NULL);
605 605
606 if(audmad_is_remote(fileurl)) { 606 if(audmad_is_remote(fileurl)) {
607 info.remote = TRUE; 607 info.remote = TRUE;
608 return; //file info dialog for remote streaming doesn't make sense. 608 if(vfs_is_streaming(info.infile))
609 } 609 return; //file info dialog for remote streaming doesn't make sense.
610 610 }
611 tmp = g_filename_from_uri(fileurl, NULL, NULL); 611
612 if (tmp == NULL) 612 realfn = g_filename_from_uri(fileurl, NULL, NULL);
613 { 613 utf_filename = str_to_utf8(realfn ? realfn : fileurl);
614 #ifdef DEBUG 614 g_free(realfn); realfn = NULL;
615 tmp = str_to_utf8(fileurl);
616 g_message("f: audmad_get_file_info: %s , g_filename_from_uri failed", tmp);
617 g_free(tmp);
618 tmp = NULL;
619 #endif
620 return;
621 }
622 utf_filename = str_to_utf8(tmp);
623 g_free(tmp);
624 tmp = NULL;
625 create_window(); 615 create_window();
626 616
627 info.fileinfo_request = TRUE; 617 info.fileinfo_request = TRUE;
628 input_get_info(&info, info.remote ? TRUE : FALSE); 618 input_get_info(&info, info.remote ? TRUE : FALSE);
629 619