summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-03-30 19:51:20 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-03-30 19:51:20 +0200
commitdb6aa2c38cbc931de32438e3085994e1fd6eb0e4 (patch)
treeb4c3dcf7cf573989bfd625bd53a7b94545365a87 /plugins
parent38b5a92feebd5501e97d4f285f25d8e9bc6bba69 (diff)
id3v2 conversions code WIP
Diffstat (limited to 'plugins')
-rw-r--r--plugins/gtkui/trkproperties.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/plugins/gtkui/trkproperties.c b/plugins/gtkui/trkproperties.c
index dfc02906..15148049 100644
--- a/plugins/gtkui/trkproperties.c
+++ b/plugins/gtkui/trkproperties.c
@@ -239,9 +239,26 @@ on_write_tags_clicked (GtkButton *button,
goto error;
}
if (deadbeef->junk_write_id3v2 (track->fname, &tag23) < 0) {
- fprintf (stderr, "failed to write tags to %s\n", track->fname);
+ fprintf (stderr, "failed to write 2.3 tag to %s\n", track->fname);
+ deadbeef->junk_free_id3v2 (&tag23);
+ goto error;
+ }
+ deadbeef->junk_free_id3v2 (&tag23);
+ }
+ else if (tag.version[0] == 3) {
+ DB_id3v2_tag_t tag24;
+ memset (&tag24, 0, sizeof (tag24));
+ int res = deadbeef->junk_id3v2_convert_23_to_24 (&tag, &tag24);
+ if (res == -1) {
+ deadbeef->junk_free_id3v2 (&tag24);
+ goto error;
+ }
+ if (deadbeef->junk_write_id3v2 (track->fname, &tag24) < 0) {
+ fprintf (stderr, "failed to write 2.4 tag to %s\n", track->fname);
+ deadbeef->junk_free_id3v2 (&tag24);
goto error;
}
+ deadbeef->junk_free_id3v2 (&tag24);
}
}