+static void
+strip_tags(TagLib::MPEG::File &file,
+ const ByteVectorSet &delete_frames,
+ char *fn)
+{
+ bool changed = false;
+ if (!delete_frames.empty() && file.hasID3v2Tag()) {
+ changed = delete_id3v2_frames(file, delete_frames);
+ }
+ if (changed || (strip_v1 && file.hasID3v1Tag()) || force_write) {
+ if (!file.save(TagLib::MPEG::File::ID3v2, strip_v1)) {
+ // Their error handling really sucks; File::save just calls fwrite),
+ // doesn't check its return value, and doesn't close or sync.
+ // File::save only returns false on higher-level classes of errors;
+ // the kinds of actual errors we'd see (permissions, disk full, NFS
+ // failure, and so on) aren't reported at all.
+ cerr << "failed to save " << fn << "; blame taglib" << endl;
+ }