Use std::stoll to convert JSON values

This commit is contained in:
FeRD (Frank Dana)
2019-08-10 11:31:08 -04:00
parent e95d18476c
commit 141e6ba61e
6 changed files with 9 additions and 8 deletions

View File

@@ -181,7 +181,7 @@ void ReaderBase::SetJsonValue(Json::Value root) {
if (!root["duration"].isNull())
info.duration = root["duration"].asDouble();
if (!root["file_size"].isNull())
info.file_size = atoll(root["file_size"].asString().c_str());
info.file_size = std::stoll(root["file_size"].asString());
if (!root["height"].isNull())
info.height = root["height"].asInt();
if (!root["width"].isNull())
@@ -211,7 +211,7 @@ void ReaderBase::SetJsonValue(Json::Value root) {
if (!root["vcodec"].isNull())
info.vcodec = root["vcodec"].asString();
if (!root["video_length"].isNull())
info.video_length = atoll(root["video_length"].asString().c_str());
info.video_length = std::stoll(root["video_length"].asString());
if (!root["video_stream_index"].isNull())
info.video_stream_index = root["video_stream_index"].asInt();
if (!root["video_timebase"].isNull() && root["video_timebase"].isObject()) {