summaryrefslogtreecommitdiff
path: root/plugins/gtkui/trkproperties.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/gtkui/trkproperties.c')
-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);
}
}