Commit ab29ff13 for libheif
commit ab29ff13c2f221d810fc5f3c7868ca1eec7e6b66
Author: Rob Smith <rob.smith@awayteam.co.uk>
Date: Wed Feb 18 14:45:09 2026 +0000
Update heif_enc.cc
Added NOTE handling to VMT parser
diff --git a/examples/heif_enc.cc b/examples/heif_enc.cc
index 3cf64dd6..5bfcd784 100644
--- a/examples/heif_enc.cc
+++ b/examples/heif_enc.cc
@@ -2244,7 +2244,8 @@ int encode_vmt_metadata_track(heif_context* context, heif_track* visual_track,
std::ifstream istr(vmt_metadata_file.c_str());
- std::regex pattern(R"(^\s*(-?(\d|:|\.)*)\s*-->\s*(-?(\d|:|\.)*)?)");
+ std::regex pattern_cue(R"(^\s*(-?(\d|:|\.)*)\s*-->\s*(-?(\d|:|\.)*)?.*)");
+ std::regex pattern_note(R"(^\s*(NOTE).*)");
static std::vector<uint8_t> prev_metadata;
static std::optional<uint32_t> prev_ts;
@@ -2254,7 +2255,17 @@ int encode_vmt_metadata_track(heif_context* context, heif_track* visual_track,
{
std::smatch match;
- if (!std::regex_match(line, match, pattern)) {
+ if (std::regex_match(line, match, pattern_note)) {
+ while (std::getline(istr, line)) {
+ if (line.empty()) {
+ break;
+ }
+ }
+
+ continue;
+ }
+
+ if (!std::regex_match(line, match, pattern_cue)) {
continue;
}