diff --git a/taglib/ape/apefile.cpp b/taglib/ape/apefile.cpp index 2572a2e9..fae4ab03 100644 --- a/taglib/ape/apefile.cpp +++ b/taglib/ape/apefile.cpp @@ -131,12 +131,12 @@ void APE::File::removeUnsupportedProperties(const StringList &properties) PropertyMap APE::File::setProperties(const PropertyMap &properties) { - if(d->hasAPE) - return d->tag.access(ApeAPEIndex, false)->setProperties(properties); - else if(d->hasID3v1) - return d->tag.access(ApeID3v1Index, false)->setProperties(properties); - else - return d->tag.access(ApeAPEIndex, true)->setProperties(properties); + PropertyMap result; + if(d->hasID3v1) + result = d->tag.access(ApeID3v1Index, false)->setProperties(properties); + if(d->hasAPE || !d->hasID3v1) + result = d->tag.access(ApeAPEIndex, true)->setProperties(properties); + return result; } APE::Properties *APE::File::audioProperties() const diff --git a/taglib/flac/flacfile.cpp b/taglib/flac/flacfile.cpp index 0bfe84c3..26d79974 100644 --- a/taglib/flac/flacfile.cpp +++ b/taglib/flac/flacfile.cpp @@ -168,14 +168,14 @@ void FLAC::File::removeUnsupportedProperties(const StringList &unsupported) PropertyMap FLAC::File::setProperties(const PropertyMap &properties) { - if(d->hasXiphComment) - return d->tag.access(FlacXiphIndex, false)->setProperties(properties); - else if(d->hasID3v2) - return d->tag.access(FlacID3v2Index, false)->setProperties(properties); - else if(d->hasID3v1) - return d->tag.access(FlacID3v1Index, false)->setProperties(properties); - else - return d->tag.access(FlacXiphIndex, true)->setProperties(properties); + PropertyMap result; + if(d->hasID3v1) + result = d->tag.access(FlacID3v1Index, false)->setProperties(properties); + if(d->hasID3v2) + result = d->tag.access(FlacID3v2Index, false)->setProperties(properties); + if(d->hasXiphComment || !(d->hasID3v1 || d->hasID3v2)) + result = d->tag.access(FlacXiphIndex, true)->setProperties(properties); + return result; } FLAC::Properties *FLAC::File::audioProperties() const diff --git a/taglib/mpc/mpcfile.cpp b/taglib/mpc/mpcfile.cpp index 18f533f8..6d6b3f6b 100644 --- a/taglib/mpc/mpcfile.cpp +++ b/taglib/mpc/mpcfile.cpp @@ -135,15 +135,14 @@ void MPC::File::removeUnsupportedProperties(const StringList &properties) PropertyMap MPC::File::setProperties(const PropertyMap &properties) { - if(d->hasAPE) - return d->tag.access(MPCAPEIndex, false)->setProperties(properties); - else if(d->hasID3v1) - return d->tag.access(MPCID3v1Index, false)->setProperties(properties); - else - return d->tag.access(APE, true)->setProperties(properties); + PropertyMap result; + if(d->hasID3v1) + result = d->tag.access(MPCID3v1Index, false)->setProperties(properties); + if(d->hasAPE || !d->hasID3v1) + result = d->tag.access(MPCAPEIndex, true)->setProperties(properties); + return result; } - MPC::Properties *MPC::File::audioProperties() const { return d->properties; diff --git a/taglib/mpeg/mpegfile.cpp b/taglib/mpeg/mpegfile.cpp index ec094cdc..90754007 100644 --- a/taglib/mpeg/mpegfile.cpp +++ b/taglib/mpeg/mpegfile.cpp @@ -156,16 +156,17 @@ void MPEG::File::removeUnsupportedProperties(const StringList &properties) else if(d->hasID3v1) d->tag.access(ID3v1Index, false)->removeUnsupportedProperties(properties); } + PropertyMap MPEG::File::setProperties(const PropertyMap &properties) { - if(d->hasID3v2) - return d->tag.access(ID3v2Index, false)->setProperties(properties); - else if(d->hasAPE) - return d->tag.access(APEIndex, false)->setProperties(properties); - else if(d->hasID3v1) - return d->tag.access(ID3v1Index, false)->setProperties(properties); - else - return d->tag.access(ID3v2Index, true)->setProperties(properties); + PropertyMap result; + if(d->hasID3v1) + result = d->tag.access(ID3v1Index, false)->setProperties(properties); + if(d->hasAPE) + result = d->tag.access(APEIndex, false)->setProperties(properties); + if(d->hasID3v2 || !(d->hasID3v1 || d->hasAPE)) + result = d->tag.access(ID3v2Index, true)->setProperties(properties); + return result; } MPEG::Properties *MPEG::File::audioProperties() const diff --git a/taglib/trueaudio/trueaudiofile.cpp b/taglib/trueaudio/trueaudiofile.cpp index 9efc6e9d..6af72aaa 100644 --- a/taglib/trueaudio/trueaudiofile.cpp +++ b/taglib/trueaudio/trueaudiofile.cpp @@ -141,12 +141,12 @@ PropertyMap TrueAudio::File::properties() const PropertyMap TrueAudio::File::setProperties(const PropertyMap &properties) { - if(d->hasID3v2) - return d->tag.access(TrueAudioID3v2Index, false)->setProperties(properties); - else if(d->hasID3v1) - return d->tag.access(TrueAudioID3v1Index, false)->setProperties(properties); - else - return d->tag.access(TrueAudioID3v2Index, true)->setProperties(properties); + PropertyMap result; + if(d->hasID3v1) + result = d->tag.access(TrueAudioID3v1Index, false)->setProperties(properties); + if(d->hasID3v2 || !d->hasID3v1) + result =d->tag.access(TrueAudioID3v2Index, true)->setProperties(properties); + return result; } TrueAudio::Properties *TrueAudio::File::audioProperties() const diff --git a/taglib/wavpack/wavpackfile.cpp b/taglib/wavpack/wavpackfile.cpp index 2d1f8cd9..6cc86527 100644 --- a/taglib/wavpack/wavpackfile.cpp +++ b/taglib/wavpack/wavpackfile.cpp @@ -119,12 +119,12 @@ PropertyMap WavPack::File::properties() const PropertyMap WavPack::File::setProperties(const PropertyMap &properties) { - if(d->hasAPE) - return d->tag.access(WavAPEIndex, false)->setProperties(properties); - else if(d->hasID3v1) - return d->tag.access(WavID3v1Index, false)->setProperties(properties); - else - return d->tag.access(APE, true)->setProperties(properties); + PropertyMap result; + if(d->hasID3v1) + result = d->tag.access(WavID3v1Index, false)->setProperties(properties); + if(d->hasAPE || !d->hasID3v1) + result = d->tag.access(WavAPEIndex, true)->setProperties(properties); + return result; } WavPack::Properties *WavPack::File::audioProperties() const