decoder/flac: support embedded pictures (FLAC__METADATA_TYPE_PICTURE)
This commit is contained in:
parent
575ba51931
commit
54daa85ac2
@ -149,6 +149,21 @@ Scan(const FLAC__StreamMetadata_StreamInfo &stream_info,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
Scan(const FLAC__StreamMetadata_Picture &picture, TagHandler &handler) noexcept
|
||||||
|
{
|
||||||
|
if (!handler.WantPicture())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (picture.mime_type != nullptr &&
|
||||||
|
StringIsEqual(picture.mime_type, "-->"))
|
||||||
|
/* this is a URL, not image data */
|
||||||
|
return;
|
||||||
|
|
||||||
|
handler.OnPicture(picture.mime_type,
|
||||||
|
{picture.data, picture.data_length});
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
flac_scan_metadata(const FLAC__StreamMetadata *block,
|
flac_scan_metadata(const FLAC__StreamMetadata *block,
|
||||||
TagHandler &handler) noexcept
|
TagHandler &handler) noexcept
|
||||||
@ -163,6 +178,10 @@ flac_scan_metadata(const FLAC__StreamMetadata *block,
|
|||||||
Scan(block->data.stream_info, handler);
|
Scan(block->data.stream_info, handler);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case FLAC__METADATA_TYPE_PICTURE:
|
||||||
|
Scan(block->data.picture, handler);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user