Update taglib
This commit is contained in:
9
3rdparty/taglib/mpeg/id3v2/id3v2frame.cpp
vendored
9
3rdparty/taglib/mpeg/id3v2/id3v2frame.cpp
vendored
@@ -111,8 +111,8 @@ Frame *Frame::createTextualFrame(const String &key, const StringList &values) //
|
||||
// check if the key is contained in the key<=>frameID mapping
|
||||
ByteVector frameID = keyToFrameID(key);
|
||||
if(!frameID.isEmpty()) {
|
||||
// Apple proprietary WFED (Podcast URL), MVNM (Movement Name), MVIN (Movement Number) are in fact text frames.
|
||||
if(frameID[0] == 'T' || frameID == "WFED" || frameID == "MVNM" || frameID == "MVIN"){ // text frame
|
||||
// Apple proprietary WFED (Podcast URL), MVNM (Movement Name), MVIN (Movement Number), GRP1 (Grouping) are in fact text frames.
|
||||
if(frameID[0] == 'T' || frameID == "WFED" || frameID == "MVNM" || frameID == "MVIN" || frameID == "GRP1"){ // text frame
|
||||
TextIdentificationFrame *frame = new TextIdentificationFrame(frameID, String::UTF8);
|
||||
frame->setText(values);
|
||||
return frame;
|
||||
@@ -394,6 +394,7 @@ namespace
|
||||
{ "WFED", "PODCASTURL" },
|
||||
{ "MVNM", "MOVEMENTNAME" },
|
||||
{ "MVIN", "MOVEMENTNUMBER" },
|
||||
{ "GRP1", "GROUPING" },
|
||||
};
|
||||
const size_t frameTranslationSize = sizeof(frameTranslation) / sizeof(frameTranslation[0]);
|
||||
|
||||
@@ -476,8 +477,8 @@ PropertyMap Frame::asProperties() const
|
||||
// workaround until this function is virtual
|
||||
if(id == "TXXX")
|
||||
return dynamic_cast< const UserTextIdentificationFrame* >(this)->asProperties();
|
||||
// Apple proprietary WFED (Podcast URL), MVNM (Movement Name), MVIN (Movement Number) are in fact text frames.
|
||||
else if(id[0] == 'T' || id == "WFED" || id == "MVNM" || id == "MVIN")
|
||||
// Apple proprietary WFED (Podcast URL), MVNM (Movement Name), MVIN (Movement Number), GRP1 (Grouping) are in fact text frames.
|
||||
else if(id[0] == 'T' || id == "WFED" || id == "MVNM" || id == "MVIN" || id == "GRP1")
|
||||
return dynamic_cast< const TextIdentificationFrame* >(this)->asProperties();
|
||||
else if(id == "WXXX")
|
||||
return dynamic_cast< const UserUrlLinkFrame* >(this)->asProperties();
|
||||
|
||||
@@ -198,8 +198,8 @@ Frame *FrameFactory::createFrame(const ByteVector &origData, Header *tagHeader)
|
||||
|
||||
// Text Identification (frames 4.2)
|
||||
|
||||
// Apple proprietary WFED (Podcast URL), MVNM (Movement Name), MVIN (Movement Number) are in fact text frames.
|
||||
if(frameID.startsWith("T") || frameID == "WFED" || frameID == "MVNM" || frameID == "MVIN") {
|
||||
// Apple proprietary WFED (Podcast URL), MVNM (Movement Name), MVIN (Movement Number), GRP1 (Grouping) are in fact text frames.
|
||||
if(frameID.startsWith("T") || frameID == "WFED" || frameID == "MVNM" || frameID == "MVIN" || frameID == "GRP1") {
|
||||
|
||||
TextIdentificationFrame *f = frameID != "TXXX"
|
||||
? new TextIdentificationFrame(data, header)
|
||||
@@ -459,6 +459,7 @@ namespace
|
||||
{ "WFD", "WFED" },
|
||||
{ "MVN", "MVNM" },
|
||||
{ "MVI", "MVIN" },
|
||||
{ "GP1", "GRP1" },
|
||||
};
|
||||
const size_t frameConversion2Size = sizeof(frameConversion2) / sizeof(frameConversion2[0]);
|
||||
|
||||
|
||||
12
3rdparty/taglib/mpeg/mpegfile.cpp
vendored
12
3rdparty/taglib/mpeg/mpegfile.cpp
vendored
@@ -109,8 +109,8 @@ bool MPEG::File::isSupported(IOStream *stream)
|
||||
const ByteVector buffer = Utils::readHeader(stream, bufferSize(), true, &headerOffset);
|
||||
|
||||
if(buffer.isEmpty())
|
||||
return false;
|
||||
|
||||
return false;
|
||||
|
||||
const long originalPosition = stream->tell();
|
||||
AdapterFile file(stream);
|
||||
|
||||
@@ -182,7 +182,7 @@ PropertyMap MPEG::File::setProperties(const PropertyMap &properties)
|
||||
{
|
||||
// update ID3v1 tag if it exists, but ignore the return value
|
||||
|
||||
if(ID3v1Tag())
|
||||
if(hasID3v1Tag())
|
||||
ID3v1Tag()->setProperties(properties);
|
||||
|
||||
return ID3v2Tag(true)->setProperties(properties);
|
||||
@@ -195,7 +195,11 @@ MPEG::Properties *MPEG::File::audioProperties() const
|
||||
|
||||
bool MPEG::File::save()
|
||||
{
|
||||
return save(AllTags);
|
||||
if (hasID3v1Tag() || !ID3v1Tag()->isEmpty()) {
|
||||
return save(AllTags, true, 4, true);
|
||||
} else {
|
||||
return save(AllTags, true, 4, false);
|
||||
}
|
||||
}
|
||||
|
||||
bool MPEG::File::save(int tags)
|
||||
|
||||
9
3rdparty/taglib/mpeg/mpegfile.h
vendored
9
3rdparty/taglib/mpeg/mpegfile.h
vendored
@@ -164,14 +164,15 @@ namespace TagLib {
|
||||
virtual Properties *audioProperties() const;
|
||||
|
||||
/*!
|
||||
* Save the file. If at least one tag -- ID3v1 or ID3v2 -- exists this
|
||||
* will duplicate its content into the other tag. This returns true
|
||||
* if saving was successful.
|
||||
* Save the file. If an ID3v1 tag exists this will duplicate the tag
|
||||
* content into the other tag. This returns true if saving was
|
||||
* successful.
|
||||
*
|
||||
* If neither exists or if both tags are empty, this will strip the tags
|
||||
* from the file.
|
||||
*
|
||||
* This is the same as calling save(AllTags);
|
||||
* This is the same as calling save(AllTags, true, 4, false); or if an
|
||||
* ID3v1 tag exists, save(AllTags, true, 4, true).
|
||||
*
|
||||
* If you would like more granular control over the content of the tags,
|
||||
* with the concession of generality, use parameterized save call below.
|
||||
|
||||
Reference in New Issue
Block a user