diff --git a/include/CacheBase.h b/include/CacheBase.h index 3760e84b..d954e411 100644 --- a/include/CacheBase.h +++ b/include/CacheBase.h @@ -32,6 +32,7 @@ #define OPENSHOT_CACHE_BASE_H #include +#include #include "Frame.h" #include "Exceptions.h" #include "Json.h" diff --git a/include/ChunkReader.h b/include/ChunkReader.h index 5b330b70..a5f2ec6a 100644 --- a/include/ChunkReader.h +++ b/include/ChunkReader.h @@ -39,7 +39,7 @@ #include #include #include -#include +#include #include #include "Json.h" #include "CacheMemory.h" diff --git a/include/ReaderBase.h b/include/ReaderBase.h index 0d14ea19..eef29fba 100644 --- a/include/ReaderBase.h +++ b/include/ReaderBase.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include "CacheMemory.h" #include "ChannelLayouts.h" diff --git a/src/CacheBase.cpp b/src/CacheBase.cpp index 0016694a..b808896e 100644 --- a/src/CacheBase.cpp +++ b/src/CacheBase.cpp @@ -71,5 +71,5 @@ void CacheBase::SetJsonValue(Json::Value root) { // Set data from Json (if key is found) if (!root["max_bytes"].isNull()) - max_bytes = atoll(root["max_bytes"].asString().c_str()); + max_bytes = std::stoll(root["max_bytes"].asString()); } diff --git a/src/ChunkReader.cpp b/src/ChunkReader.cpp index 9fc8756c..0836f09f 100644 --- a/src/ChunkReader.cpp +++ b/src/ChunkReader.cpp @@ -94,7 +94,7 @@ void ChunkReader::load_json() info.has_video = root["has_video"].asBool(); info.has_audio = root["has_audio"].asBool(); info.duration = root["duration"].asDouble(); - info.file_size = atoll(root["file_size"].asString().c_str()); + info.file_size = std::stoll(root["file_size"].asString()); info.height = root["height"].asInt(); info.width = root["width"].asInt(); info.pixel_format = root["pixel_format"].asInt(); @@ -106,7 +106,7 @@ void ChunkReader::load_json() info.display_ratio.num = root["display_ratio"]["num"].asInt(); info.display_ratio.den = root["display_ratio"]["den"].asInt(); info.vcodec = root["vcodec"].asString(); - info.video_length = atoll(root["video_length"].asString().c_str()); + info.video_length = std::stoll(root["video_length"].asString()); info.video_stream_index = root["video_stream_index"].asInt(); info.video_timebase.num = root["video_timebase"]["num"].asInt(); info.video_timebase.den = root["video_timebase"]["den"].asInt(); @@ -316,7 +316,7 @@ void ChunkReader::SetJsonValue(Json::Value root) { if (!root["path"].isNull()) path = root["path"].asString(); if (!root["chunk_size"].isNull()) - chunk_size = atoll(root["chunk_size"].asString().c_str()); + chunk_size = std::stoll(root["chunk_size"].asString()); if (!root["chunk_version"].isNull()) version = (ChunkVersion) root["chunk_version"].asInt(); diff --git a/src/ReaderBase.cpp b/src/ReaderBase.cpp index 30706866..e23fdd85 100644 --- a/src/ReaderBase.cpp +++ b/src/ReaderBase.cpp @@ -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()) {