comparison Plugins/Input/mpg123/mpg123.c @ 1105:4be4d74db123 trunk

[svn] automatic character encoding detector for id3 metadata. --enable-chardet enables this feature.
author yaz
date Sat, 27 May 2006 11:02:08 -0700
parents b5ae09a6c2f1
children c4063c84b797
comparison
equal deleted inserted replaced
1104:c2fc86e40fba 1105:4be4d74db123
492 REMOVE_NONEXISTANT_TAG(input->album_name); 492 REMOVE_NONEXISTANT_TAG(input->album_name);
493 REMOVE_NONEXISTANT_TAG(input->track_name); 493 REMOVE_NONEXISTANT_TAG(input->track_name);
494 REMOVE_NONEXISTANT_TAG(input->genre); 494 REMOVE_NONEXISTANT_TAG(input->genre);
495 REMOVE_NONEXISTANT_TAG(input->comment); 495 REMOVE_NONEXISTANT_TAG(input->comment);
496 } 496 }
497 497 if(input->performer)
498 input->performer = str_to_utf8(input->performer);
499
500 if(input->album_name)
501 input->album_name = str_to_utf8(input->album_name);
502
503 if(input->track_name)
504 input->track_name = str_to_utf8(input->track_name);
505
506 if(input->comment)
507 input->comment = str_to_utf8(input->comment);
508
509
498 input->file_name = g_path_get_basename(filename); 510 input->file_name = g_path_get_basename(filename);
499 input->file_path = g_path_get_dirname(filename); 511 input->file_path = g_path_get_dirname(filename);
500 input->file_ext = extname(filename); 512 input->file_ext = extname(filename);
501 513
502 title = xmms_get_titlestring(mpgdec_cfg.title_override ? 514 title = xmms_get_titlestring(mpgdec_cfg.title_override ?
507 /* Format according to filename. */ 519 /* Format according to filename. */
508 title = g_path_get_basename(filename); 520 title = g_path_get_basename(filename);
509 if (extname(title)) 521 if (extname(title))
510 *(extname(title) - 1) = '\0'; /* removes period */ 522 *(extname(title) - 1) = '\0'; /* removes period */
511 } 523 }
524
525 if(input->performer)
526 g_free(input->performer);
527 if(input->album_name)
528 g_free(input->album_name);
529 if(input->track_name)
530 g_free(input->track_name);
531 if(input->comment)
532 g_free(input->comment);
512 533
513 g_free(input->file_path); 534 g_free(input->file_path);
514 g_free(input->file_name); 535 g_free(input->file_name);
515 g_free(input); 536 g_free(input);
516 537
523 */ 544 */
524 static gchar * 545 static gchar *
525 get_song_title(char *filename) 546 get_song_title(char *filename)
526 { 547 {
527 char *ret = NULL; 548 char *ret = NULL;
549 #ifdef USE_CHARDET
550 taglib_set_strings_unicode(FALSE);
551 #endif
528 taglib_file = taglib_file_new(filename); 552 taglib_file = taglib_file_new(filename);
529 taglib_tag = NULL; 553 taglib_tag = NULL;
530 if(taglib_file) { 554 if(taglib_file) {
531 taglib_tag = taglib_file_tag(taglib_file); 555 taglib_tag = taglib_file_tag(taglib_file);
532 taglib_ap = taglib_file_audioproperties(taglib_file); 556 taglib_ap = taglib_file_audioproperties(taglib_file);