comparison src/tta/libtta.c @ 2165:624eb07fe591

- set FIELD_LENGTH. - id3_file_open no longer needs unescaped file name.
author Yoshiki Yazawa <yaz@cc.rim.or.jp>
date Tue, 13 Nov 2007 05:25:42 +0900
parents 2f2ffbc2d04d
children 137187e7a379
comparison
equal deleted inserted replaced
2164:9dec1bf7edde 2165:624eb07fe591
579 if(ttainfo->ID3.genre) 579 if(ttainfo->ID3.genre)
580 aud_tuple_associate_string(tuple, FIELD_GENRE, NULL, (gchar *) ttainfo->ID3.genre); 580 aud_tuple_associate_string(tuple, FIELD_GENRE, NULL, (gchar *) ttainfo->ID3.genre);
581 581
582 if(ttainfo->ID3.comment) 582 if(ttainfo->ID3.comment)
583 aud_tuple_associate_string(tuple, FIELD_COMMENT, NULL, (gchar *) ttainfo->ID3.comment); 583 aud_tuple_associate_string(tuple, FIELD_COMMENT, NULL, (gchar *) ttainfo->ID3.comment);
584 if(ttainfo->LENGTH)
585 aud_tuple_associate_int(tuple, FIELD_LENGTH, NULL, 1000 * ttainfo->LENGTH);
586
584 } 587 }
585 close_tta_file (ttainfo); 588 close_tta_file (ttainfo);
586 } 589 }
587 aud_vfs_fclose(file); 590 aud_vfs_fclose(file);
588 } 591 }
801 } 804 }
802 805
803 int get_id3_tags (const char *filename, tta_info *ttainfo) { 806 int get_id3_tags (const char *filename, tta_info *ttainfo) {
804 int id3v2_size = 0; 807 int id3v2_size = 0;
805 gchar *str = NULL; 808 gchar *str = NULL;
806 gchar *realfn = NULL;
807 809
808 struct id3_file *id3file = NULL; 810 struct id3_file *id3file = NULL;
809 struct id3_tag *tag = NULL; 811 struct id3_tag *tag = NULL;
810 812
811 realfn = g_filename_from_uri(filename, NULL, NULL); 813 id3file = id3_file_open (filename, ID3_FILE_MODE_READONLY);
812 id3file = id3_file_open (realfn ? realfn : filename, ID3_FILE_MODE_READONLY);
813 g_free(realfn); realfn = NULL;
814 814
815 if (id3file) { 815 if (id3file) {
816 tag = id3_file_tag (id3file); 816 tag = id3_file_tag (id3file);
817 817
818 if (tag) { 818 if (tag) {