Repository navigation
12109 metadata export fix - #12515
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: 🟡 Moderate · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI (base), Organization UI (inherited)
- Review profile: CHILL
- Plan: Advanced
- Run ID:
8ad3f0ee-a866-4c95-bc1f-ee4359c5f9b2
📒 Files selected for processing: 15
au3/libraries/au3-import-export/Import.cppau3/modules/import-export/mod-flac/CMakeLists.txtau3/modules/import-export/mod-mp2/CMakeLists.txtau3/modules/import-export/mod-mp3/CMakeLists.txtau3/modules/import-export/mod-pcm/CMakeLists.txtbuildscripts/cmake/DependencyManifest.cmakemuse_depssrc/importexport/export/tests/CMakeLists.txtsrc/importexport/export/tests/environment.cppsrc/importexport/export/tests/metadataroundtrip_tests.cppsrc/importexport/import/internal/au3/au3importer.cppsrc/project/internal/au3/au3metadata.cppsrc/project/tests/CMakeLists.txtsrc/project/tests/au3metadata_tests.cppsrc/project/types/projectmeta.h
💤 Files with no reviewable changes: 1
- src/project/internal/au3/au3metadata.cpp
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| FLAC::FLAC | ||
| FLAC::FLAC++ | ||
| rapidjson::rapidjson | ||
| libid3tag::libid3tag |
There was a problem hiding this comment.
Is libid3tag needed for all these formats?
Currently FLAC is exported just fine on master and 4.0.1
There was a problem hiding this comment.
Good observation, I didn't realize that. I dug into this, and it's a bit complicated once again :)
ImportFLAC.cpp uses it:
#ifdef USE_LIBID3TAG
// Skip any ID3 tags that might be present
id3_byte_t query[ID3_TAG_QUERYSIZE];
cnt = binaryFile.Read(query, sizeof(query));
cnt = id3_tag_query(query, cnt);
binaryFile.Seek(cnt);
#endif
char buf[5];
cnt = binaryFile.Read(buf, 4);
binaryFile.Close();
if (cnt == wxInvalidOffset || strncmp(buf, FLAC_HEADER, 4) != 0) {
// File is not a FLAC file
return nullptr;
}The code skips ID3 tags present in a flac's header, because otherwise the if after wouldn't recognize it as a flac file. The comment doesn't say why an ID3 tag might be present in a flac header, the bot hypothesizes that some file taggers can add ID3 tags to a flac file. In any case, the dev who wrote this (I didn't look who) must've hit this case.
What would happen with such a file without us using libid3tag? Looks like ffmpeg would catch it: I just tried the TEST_P(MetadataRoundTripTests, TagsSurviveExportAndImport) with FFmpeg at the beginning of the wxT("AUP,PCM,OGG,Opus,FLAC,MP3,LOF,WavPack,portsmf,FFmpeg") list in Import.cpp. The test fails because the Artist and Year fields are empty, but otherwise it's fine.
To complicate things some more: in your experiment, ExportFLAC.cpp does the export, but it's actually ImportPCM that does the import :) libsndfile uses flac (set(DEP_DEPENDS ogg vorbis flac opus) in libsndfile's spec.cmake), and since it's tried before FLAC, it works.
According to the bot, which created an experiment where an ID3 tag was added to a flac file, both libsndfile and ffmpeg can handle it. So in summary: if we remove this dependency, it'd only bite us the day we drop libsndfile and ffmpeg.
In principle it's better to keep it, but if for some reasons we should remove this dependency, there'd be two safety belts. I don't see the harm in keeping it, though.
There was a problem hiding this comment.
oh, I would never imagine that metadata topic might be so complicated. Thank you for the detailed answer.
d7293e8 to
a126c11
Compare
[ FAILED ] 9 tests, listed below: [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.TagsSurviveExportAndImport/MP3, where GetParam() = MP3 [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.TagsSurviveExportAndImport/MP2, where GetParam() = MP2 [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.TagsSurviveExportAndImport/WAV, where GetParam() = WAV [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.TagsSurviveExportAndImport/AIFF, where GetParam() = AIFF [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.TagsSurviveExportAndImport/Opus, where GetParam() = Opus [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.WritesId3v23Tag/MP3, where GetParam() = MP3 [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.WritesId3v23Tag/MP2, where GetParam() = MP2 [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.WritesId3v23Tag/WAV, where GetParam() = WAV [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.WritesId3v23Tag/AIFF, where GetParam() = AIFF Assisted-by: Claude w Opus 5.5
Fixes a lot, but not all written tests: [ FAILED ] 1 test, listed below: [ FAILED ] AllFormatsWithMetadata/MetadataRoundTripTests.TagsSurviveExportAndImport/Opus, where GetParam() = Opus Assisted-by: Claude w Opus 5.5
Add Opus to the ordered preference list of codec candidates No more failing tests Assisted-by: Claude w Opus 5.5
a126c11 to
e8a7ff2
Compare
Resolves: #12109
Using the libid3tags library is the main fix.
However, there were other smaller metadata bugs:
Unit tests were written for each of those.
(Another bug was found in the doing, but it's a separate place, so it got a ticket of its own: #12511)
Recommended: