summaryrefslogtreecommitdiff
path: root/src/verify.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-12-23 15:32:01 +0100
committerCarl Hetherington <cth@carlh.net>2024-12-23 17:34:47 +0100
commit77f52850eb56fa72bca3c072e9445649dc85493c (patch)
tree19c0059c2a30b71028dfaa64f073ec8893546e66 /src/verify.cc
parenta66f89834d66c089d3328f36d319821d110b7ea1 (diff)
Use fmt for conversions from number to string (instead of raw_convert).
Diffstat (limited to 'src/verify.cc')
-rw-r--r--src/verify.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/verify.cc b/src/verify.cc
index 68f838cf..15fb0608 100644
--- a/src/verify.cc
+++ b/src/verify.cc
@@ -45,7 +45,6 @@
#include "interop_text_asset.h"
#include "mono_j2k_picture_asset.h"
#include "mono_j2k_picture_frame.h"
-#include "raw_convert.h"
#include "reel.h"
#include "reel_interop_text_asset.h"
#include "reel_markers_asset.h"
@@ -78,6 +77,7 @@
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/sax/HandlerBase.hpp>
#include <xercesc/util/PlatformUtils.hpp>
+#include <fmt/core.h>
#include <boost/algorithm/string.hpp>
#include <iostream>
#include <map>
@@ -639,10 +639,10 @@ verify_main_sound_asset(Context& context, shared_ptr<const ReelSoundAsset> reel_
verify_language_tag(context, *lang);
}
if (asset->sampling_rate() != 48000) {
- context.bv21_error(VerificationNote::Code::INVALID_SOUND_FRAME_RATE, raw_convert<string>(asset->sampling_rate()), file);
+ context.bv21_error(VerificationNote::Code::INVALID_SOUND_FRAME_RATE, fmt::to_string(asset->sampling_rate()), file);
}
if (asset->bit_depth() != 24) {
- context.error(VerificationNote::Code::INVALID_SOUND_BIT_DEPTH, raw_convert<string>(asset->bit_depth()), file);
+ context.error(VerificationNote::Code::INVALID_SOUND_BIT_DEPTH, fmt::to_string(asset->bit_depth()), file);
}
}
@@ -695,7 +695,7 @@ verify_smpte_timed_text_asset (
auto const size = filesystem::file_size(asset->file().get());
if (size > 115 * 1024 * 1024) {
- context.bv21_error(VerificationNote::Code::INVALID_TIMED_TEXT_SIZE_IN_BYTES, raw_convert<string>(size), *asset->file());
+ context.bv21_error(VerificationNote::Code::INVALID_TIMED_TEXT_SIZE_IN_BYTES, fmt::to_string(size), *asset->file());
}
/* XXX: I'm not sure what Bv2.1_7.2.1 means when it says "the font resource shall not be larger than 10MB"
@@ -707,7 +707,7 @@ verify_smpte_timed_text_asset (
total_size += i.second.size();
}
if (total_size > 10 * 1024 * 1024) {
- context.bv21_error(VerificationNote::Code::INVALID_TIMED_TEXT_FONT_SIZE_IN_BYTES, raw_convert<string>(total_size), asset->file().get());
+ context.bv21_error(VerificationNote::Code::INVALID_TIMED_TEXT_FONT_SIZE_IN_BYTES, fmt::to_string(total_size), asset->file().get());
}
if (!asset->start_time()) {
@@ -840,7 +840,7 @@ verify_closed_caption_asset (
if (raw_xml) {
validate_xml(context, *raw_xml);
if (raw_xml->size() > 256 * 1024) {
- context.bv21_error(VerificationNote::Code::INVALID_CLOSED_CAPTION_XML_SIZE_IN_BYTES, raw_convert<string>(raw_xml->size()), *asset->file());
+ context.bv21_error(VerificationNote::Code::INVALID_CLOSED_CAPTION_XML_SIZE_IN_BYTES, fmt::to_string(raw_xml->size()), *asset->file());
}
} else {
context.warning(VerificationNote::Code::MISSED_CHECK_OF_ENCRYPTED);
@@ -1666,7 +1666,7 @@ verify_cpl(Context& context, shared_ptr<const CPL> cpl)
if (ffoc == markers_seen.end()) {
context.warning(VerificationNote::Code::MISSING_FFOC);
} else if (ffoc->second.e != 1) {
- context.warning(VerificationNote::Code::INCORRECT_FFOC, raw_convert<string>(ffoc->second.e));
+ context.warning(VerificationNote::Code::INCORRECT_FFOC, fmt::to_string(ffoc->second.e));
}
auto lfoc = markers_seen.find(Marker::LFOC);
@@ -1675,7 +1675,7 @@ verify_cpl(Context& context, shared_ptr<const CPL> cpl)
} else {
auto lfoc_time = lfoc->second.as_editable_units_ceil(lfoc->second.tcr);
if (lfoc_time != (cpl->reels().back()->duration() - 1)) {
- context.warning(VerificationNote::Code::INCORRECT_LFOC, raw_convert<string>(lfoc_time));
+ context.warning(VerificationNote::Code::INCORRECT_LFOC, fmt::to_string(lfoc_time));
}
}