Bug 475352 - FLAC Ogg files incorrectly use the TagLib::Ogg::Vorbis extractor instead of TagLib::Ogg::FLAC
Summary: FLAC Ogg files incorrectly use the TagLib::Ogg::Vorbis extractor instead of T...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kfilemetadata
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.111.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Pinak Ahuja
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-08 08:10 UTC by Charlemagne Lasse
Modified: 2023-11-27 20:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charlemagne Lasse 2023-10-08 08:10:05 UTC
SUMMARY

All my CDs are ripped in the modern flac inside an Ogg container format - as recommended by the Vorbis foundation since RFC 5334.


STEPS TO REPRODUCE
1. Get an audio CD
2. rip it with cdparanoia:   cdparanoia -Bv
3. convert it with flag: for i in *.wav; do flac --ogg --best $i && rm $i; done
4. try to scan and/or open it directly with flag
5. get frustrated that it doesn't play anything

OBSERVED RESULT

Elisa doesn't scan them and doesn't play them when opened manually


EXPECTED RESULT

It just works fine like all the other files (opus, ogg, flac, ...).

Interestingly, it works when renaming the file from oga (which is the correct file ending) to flac (which is wrong). What still doesn't work is the metadata (from the ogg container).

Please check https://websvn.kde.org/?revision=761962&view=revision + https://websvn.kde.org/?revision=717998&view=revision for the amarok fix.
Comment 1 Jack Hill 2023-10-27 15:12:25 UTC
Can confirm. Interestingly oga files worked fine when I was using KFileMetadata built without Taglib, so maybe the issue is somewhere upstream. I'll look into it.
Comment 2 Jack Hill 2023-11-07 12:54:01 UTC
I think the issue is in KFileMetadata which correctly reads the mimetype of FLAC Ogg files as audio/ogg but does not check what the codec is. Therefore it ends up using the wrong Taglib extractor (should use TagLib::Ogg::FLAC but uses TagLib::Ogg::Vorbis)

Types which use the oga extension: https://wiki.xiph.org/MIME_Types_and_File_Extensions#.oga_-_audio/ogg
Comment 3 Jack Hill 2023-11-07 13:01:48 UTC
Btw I tested KFileMetadata by doing:

1. cd kfilemetadata/autotests/samplefiles
2. flac --ogg test.flac -o test.flac.oga
3. ffprobe test.flac.oga # Check the file is FLAC Ogg
4. Add "flac.oga" extension to taglibextractortest.cpp
5. Run taglibextractortest

Output:
Test fails

Expected output:
Test passes
Comment 4 Bug Janitor Service 2023-11-11 01:49:24 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kfilemetadata/-/merge_requests/111
Comment 5 Stefan Brüns 2023-11-11 01:53:26 UTC
The mimetype for FLAC in a Ogg transport layer stream is "audio/x-flac+ogg". This is currently not supported by kfilemetadata.
Comment 6 Stefan Brüns 2023-11-11 23:19:30 UTC
Git commit e2b64ea0fdcf8978ffe36fc81783bf19f0a7ca07 by Stefan Brüns.
Committed on 11/11/2023 at 02:48.
Pushed by bruns into branch 'master'.

[TaglibExtractor] Add support for Ogg stream with FLAC (audio/x-flac+ogg)

FLAC audio was only supported as standalone streams, but not the newer
FLAC stream wrapped in Ogg transport layer.

Use the corresponding taglib handler, and add a test file covering
basic stream information, metadata tags and cover art extraction.

M  +3    -0    autotests/extractorcoveragetest.cpp
A  +-    --    autotests/samplefiles/test.flac.ogg
M  +12   -0    autotests/taglibextractortest.cpp
M  +11   -0    src/extractors/taglibextractor.cpp
M  +1    -0    src/extractors/taglibextractor.json

https://invent.kde.org/frameworks/kfilemetadata/-/commit/e2b64ea0fdcf8978ffe36fc81783bf19f0a7ca07
Comment 7 Stefan Brüns 2023-11-12 00:11:19 UTC
Git commit 1af1bfc1da39eb8d702a22eb1c467321ec993ff8 by Stefan Brüns.
Committed on 12/11/2023 at 01:10.
Pushed by bruns into branch 'kf5'.

[TaglibExtractor] Add support for Ogg stream with FLAC (audio/x-flac+ogg)

FLAC audio was only supported as standalone streams, but not the newer
FLAC stream wrapped in Ogg transport layer.

Use the corresponding taglib handler, and add a test file covering
basic stream information, metadata tags and cover art extraction.
(cherry picked from commit e2b64ea0fdcf8978ffe36fc81783bf19f0a7ca07)

M  +3    -0    autotests/extractorcoveragetest.cpp
A  +-    --    autotests/samplefiles/test.flac.ogg
M  +12   -0    autotests/taglibextractortest.cpp
M  +11   -0    src/extractors/taglibextractor.cpp
M  +1    -0    src/extractors/taglibextractor.json

https://invent.kde.org/frameworks/kfilemetadata/-/commit/1af1bfc1da39eb8d702a22eb1c467321ec993ff8
Comment 8 Stefan Brüns 2023-11-27 18:02:52 UTC
Fix available, needs confirmation.
Comment 9 Charlemagne Lasse 2023-11-27 20:15:21 UTC
Thanks for the fix. Ive tested it this weekend - but under Linux. Without the patch, I had the problem. After applying the patch, the problem went away and Elisa was able to add oga (flac) files to the database and also to play them. This included cover art and other metadata.