aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2011-10-24 20:40:23 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2011-10-24 20:40:23 +0000
commit6046e5ac1f01036bbf31710f05ed9355cbbc949e (patch)
tree36d6c8c23153698f03195a44fa27b7645891fb55
parentc873bed3df4aea7aba1f259c2dfb518599900946 (diff)
downloadqmmp-6046e5ac1f01036bbf31710f05ed9355cbbc949e.tar.gz
qmmp-6046e5ac1f01036bbf31710f05ed9355cbbc949e.tar.bz2
qmmp-6046e5ac1f01036bbf31710f05ed9355cbbc949e.zip
converter: do not write ID3v1 tags
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@2437 90c681e8-e032-0410-971d-27865f9a5e38
-rw-r--r--src/plugins/General/converter/converter.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugins/General/converter/converter.cpp b/src/plugins/General/converter/converter.cpp
index c7bb6c02e..be34cf433 100644
--- a/src/plugins/General/converter/converter.cpp
+++ b/src/plugins/General/converter/converter.cpp
@@ -27,6 +27,7 @@
#include <QtEndian>
#include <taglib/fileref.h>
#include <taglib/tag.h>
+#include <taglib/mpegfile.h>
#include "converter.h"
#define QStringToTString_qt4(s) TagLib::String(s.toUtf8().constData(), TagLib::String::UTF8)
@@ -207,7 +208,7 @@ void Converter::run()
0x64, 0x61, 0x74, 0x61, //"data"
0x00, 0x00, 0x00, 0x00 }; //chunk size*/
- quint16 sample_size = preset["use_16bit"].toBool() ? 2 : ap.sampleSize();
+ quint16 sample_size = preset["use_16bit"].toBool() ? 2 : ap.sampleSize();
quint32 sample_rate = qToLittleEndian(ap.sampleRate());
quint16 channels = qToLittleEndian((quint16)ap.channels());
quint16 block_align = qToLittleEndian((quint16)sample_size * ap.channels());
@@ -270,7 +271,14 @@ void Converter::run()
file.tag()->setComment(QStringToTString_qt4(metadata[Qmmp::COMMENT]));
file.tag()->setYear(metadata[Qmmp::YEAR].toUInt());
file.tag()->setTrack(metadata[Qmmp::TRACK].toUInt());
- file.save();
+
+ if(full_path.endsWith(".mp3"))
+ {
+ TagLib::MPEG::File *mpeg_file = dynamic_cast <TagLib::MPEG::File *> (file.file());
+ mpeg_file->save(TagLib::MPEG::File::ID3v2, true);
+ }
+ else
+ file.save();
}
}
}