decoder/{opus,vorbis}: support embedded pictures (METADATA_BLOCK_PICTURE)

More for https://github.com/MusicPlayerDaemon/MPD/issues/42
This commit is contained in:
Max Kellermann
2019-08-13 12:22:11 +02:00
parent 2b837277c1
commit 433e18b247
9 changed files with 212 additions and 0 deletions

View File

@@ -19,6 +19,7 @@
#include "OpusTags.hxx"
#include "OpusReader.hxx"
#include "lib/xiph/VorbisPicture.hxx"
#include "lib/xiph/XiphTags.hxx"
#include "tag/Handler.hxx"
#include "tag/ParseName.hxx"
@@ -45,6 +46,10 @@ ScanOneOpusTag(StringView name, StringView value,
ReplayGainInfo *rgi,
TagHandler &handler) noexcept
{
if (handler.WantPicture() &&
name.EqualsIgnoreCase("METADATA_BLOCK_PICTURE"))
return ScanVorbisPicture(value, handler);
if (value.size >= 4096)
/* ignore large values */
return;

View File

@@ -192,6 +192,7 @@ decoder_plugins = static_library(
decoder_plugins_dep = declare_dependency(
link_with: decoder_plugins,
dependencies: [
crypto_base64_dep,
decoder_api_dep,
pcm_dep,
],