Skip to content

Commit 582f1d9

Browse files
committed
fix: complete todo to turn cache path in environment variable
Signed-off-by: deltag0 <ioan.1931@gmail.com>
1 parent 5274cf8 commit 582f1d9

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

src/lib/image/MovieFFMpeg/MovieFFMpeg.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <boost/thread/lock_algorithms.hpp>
2424
#include <boost/thread/mutex.hpp>
2525
#include <cstddef>
26-
#include <filesystem>
2726
#include <iostream>
2827
#include <iomanip>
2928
#include <algorithm>
@@ -66,6 +65,7 @@ extern "C"
6665
#endif
6766

6867
static ENVVAR_BOOL(evUseUploadedMovieForStreaming, "RV_SHOTGRID_USE_UPLOADED_MOVIE_FOR_STREAMING", false);
68+
static ENVVAR_STRING(evStreamCachePath, "RV_STREAM_CACHE_PATH", "/tmp");
6969

7070
namespace TwkMovie
7171
{
@@ -1359,12 +1359,10 @@ namespace TwkMovie
13591359
if (filepathIsURL)
13601360
{
13611361
safe_path = "shared:" + safe_path;
1362-
//!TODO turn this into a env variable
1363-
const std::string cachePath = (std::filesystem::path("/").root_path() / "tmp").string();
13641362
av_dict_set_int(&fmtOptions, "seekable", 1, 0);
13651363
av_dict_set_int(&fmtOptions, "reconnect", 1, 0);
13661364
av_dict_set_int(&fmtOptions, "multiple_requests", 1, 0);
1367-
av_dict_set(&fmtOptions, "cache_dir", cachePath.c_str(), 0);
1365+
av_dict_set(&fmtOptions, "cache_dir", evStreamCachePath.getValue().c_str(), 0);
13681366

13691367
for (int i = 0; i < m_request.parameters.size(); i++)
13701368
{

src/lib/image/TwkMovie/MovieIO.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <TwkUtil/File.h>
1010
#include <TwkUtil/PathConform.h>
1111
#include <stream/StreamPreloadPool.h>
12-
#include <filesystem>
1312
#include <boost/algorithm/string/replace.hpp>
1413
#include <TwkUtil/EnvVar.h>
1514
#include <stdarg.h>
@@ -32,6 +31,7 @@
3231
#endif
3332

3433
static ENVVAR_BOOL(evUseUploadedMovieForStreaming, "RV_SHOTGRID_USE_UPLOADED_MOVIE_FOR_STREAMING", false);
34+
static ENVVAR_STRING(evStreamCachePath, "RV_STREAM_CACHE_PATH", "/tmp");
3535

3636
static std::mutex plugin_mutex;
3737

@@ -112,11 +112,8 @@ namespace TwkMovie
112112

113113
url = "shared:" + url;
114114

115-
// TODO: turn this into an env variable
116-
const std::filesystem::path cachePath = std::filesystem::path("/").root_path() / "tmp";
117-
118115
StreamerPool::Options options;
119-
options.push_back(std::make_pair("cache_dir", cachePath.string()));
116+
options.push_back(std::make_pair("cache_dir", evStreamCachePath.getValue()));
120117
options.push_back(std::make_pair("seekable", "1"));
121118
options.push_back(std::make_pair("reconnect", "1"));
122119
options.push_back(std::make_pair("multiple_requests", "1"));

0 commit comments

Comments
 (0)