Prefer first embedded image that contains the 'front' keyword

This commit is contained in:
emeric
2024-12-08 11:53:31 +01:00
parent def4d8c3e3
commit 38efdfaf87
6 changed files with 65 additions and 13 deletions
+1 -3
View File
@@ -281,9 +281,7 @@ namespace lms::av
const AVPacket& pkt{ avstream->attached_pic };
picture.data = reinterpret_cast<const std::byte*>(pkt.data);
picture.dataSize = pkt.size;
picture.data = std::span{ reinterpret_cast<const std::byte*>(pkt.data), static_cast<std::size_t>(pkt.size) };
func(picture, metadata);
}
}
+2 -2
View File
@@ -23,6 +23,7 @@
#include <filesystem>
#include <functional>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <unordered_map>
@@ -60,8 +61,7 @@ namespace lms::av
struct Picture
{
std::string mimeType;
const std::byte* data{}; // valid as long as IAudioFile exists
std::size_t dataSize{};
std::span<const std::byte> data; // valid as long as IAudioFile exists
};
struct ContainerInfo