tag/VorbisComment: use std::string_view

This commit is contained in:
Max Kellermann
2022-06-30 10:53:54 +02:00
parent 455a412aaa
commit 4765726bda
5 changed files with 19 additions and 21 deletions

View File

@@ -29,12 +29,12 @@
* the comment value into the tag.
*/
static bool
vorbis_copy_comment(StringView comment,
StringView name, TagType tag_type,
vorbis_copy_comment(std::string_view comment,
std::string_view name, TagType tag_type,
TagHandler &handler) noexcept
{
const auto value = GetVorbisCommentValue(comment, name);
if (!value.IsNull()) {
if (value.data() != nullptr) {
handler.OnTag(tag_type, value);
return true;
}

View File

@@ -68,8 +68,8 @@ vorbis_scan_comment(StringView comment, TagHandler &handler) noexcept
{
const auto picture_b64 = handler.WantPicture()
? GetVorbisCommentValue(comment, "METADATA_BLOCK_PICTURE")
: nullptr;
if (!picture_b64.IsNull())
: std::string_view{};
if (picture_b64.data() != nullptr)
return ScanVorbisPicture(picture_b64, handler);
ScanVorbisComment(comment, handler);