From 6046e5ac1f01036bbf31710f05ed9355cbbc949e Mon Sep 17 00:00:00 2001 From: trialuser02 Date: Mon, 24 Oct 2011 20:40:23 +0000 Subject: 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 --- src/plugins/General/converter/converter.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/plugins/General') 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 #include #include +#include #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 (file.file()); + mpeg_file->save(TagLib::MPEG::File::ID3v2, true); + } + else + file.save(); } } } -- cgit v1.2.3-13-gbd6f