aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-07-08 14:12:05 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-07-08 14:12:05 +0300
commite906e318c552d89fdd7d56045cc0fe15a5853547 (patch)
tree448892b20487e6929c4971ab4aec64f4ead6508b /src
parent3d82867917b5a5d517a0b238b7f0dbd244855dec (diff)
downloadidest-e906e318c552d89fdd7d56045cc0fe15a5853547.tar.gz
idest-e906e318c552d89fdd7d56045cc0fe15a5853547.tar.bz2
Make sure no old tag instances remain after modifications.
* src/guile.c (guile_transform): Remove existing tags prior to installing new ones. * src/idop.c (set_tags): Remove all existing instances of the tag except the first one prior to altering it. * libid3tag/frame.c: Add type casts. * libid3tag/render.c: Likewise. * libid3tag/tag.c: Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/guile.c6
-rw-r--r--src/idop.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/src/guile.c b/src/guile.c
index 992b5d4..cd95024 100644
--- a/src/guile.c
+++ b/src/guile.c
@@ -310,8 +310,12 @@ guile_transform(const char *file, struct id3_tag *tag)
result = guile_apply_main(file, tag);
- if (scm_is_pair(result))
+ if (scm_is_pair(result)) {
+ /* Remove all existing tags */
+ id3_tag_clearframes(tag);
+ /* Replace them with the new ones */
return scm_to_tag(result, tag);
+ }
return 0;
}
diff --git a/src/idop.c b/src/idop.c
index 79f9491..7310aad 100644
--- a/src/idop.c
+++ b/src/idop.c
@@ -114,6 +114,14 @@ set_tags(const char *name)
frame = id3_frame_new(item->id);
if (id3_tag_attachframe(tag, frame))
error(1, 0, "cannot attach new frame");
+ } else {
+ struct id3_frame *fp;
+
+ while (fp = id3_tag_findframe(tag, item->id,
+ 1)) {
+ id3_tag_detachframe(tag, fp);
+ id3_frame_delete(fp);
+ }
}
set_frame_value(frame, item->v.value);
modified |= 1;

Return to:

Send suggestions and report system problems to the System administrator.